Howtos

The following examples demonstrate the featues of Asido. For all of those the GD and GD_Hack drivers are used since they are the most common ones and all those examples should run as they are on most machines.

The adjustments that you might have to apply are to set the correct path to the Asido library and probably using a different driver (if the machines does not support the pre-selected GD and GD_Hack, or if you want to test the result from the rest of the drivers).

For starters, here’s a very basic example, which first watermarks an image, and then resizes the result:

<?php
 
/**
* Set the path to the Asido library
*/
include('./../../asido/dev/class.asido.php');
 
/**
* Use the GD driver
*/
asido::driver('gd');
 
/**
* Create an Asido_Image object
*/
$i1 = asido::image(
      'the-source-image.jpg',
      'filename-with-which-you-want-to-save-the-result.png'
);
 
/**
* Watermark it
*/
asido::watermark($i1, 'put-the-watermark-image-here.png');
 
/**
* Resize it proportionally to make it fit inside a 400x400 frame
*/
asido::resize($i1, 400, 400, ASIDO_RESIZE_PROPORTIONAL);
 
/**
* Save it and overwrite the file if it exists
*/
$i1->save(ASIDO_OVERWRITE_ENABLED);
 
?>

Check the permissions: make sure that the source file is readable, and the destination file is writable.


More Examples

In the list below you can find other howtos and examples:

Watermarks w/ GIFs and JPEGs

Wednesday, April 25th, 2007

This example shows the result when using non-transparent images like JPEGs, or using files with non-alpha transparency like GIFs.

Watermark Scaling w/ Scaling Factor

Wednesday, April 25th, 2007

This example shows how the watermark scaling factor works.

Watermark Scaling

Wednesday, April 25th, 2007

This example shows how the watermark scaling works: another one of Asido unique features.

Tile Watermark

Wednesday, April 25th, 2007

This example demonstrates an unique feature of Asido to apply a tile watermark.

Watermark Gravity

Saturday, April 21st, 2007

This example demonstrates how to use the watermark gravity.


To check the complete collection of examples, explore the Howtos archive.
Powered by WordPress
Asido: PHP Image Processing Solution