Source for file example_02.php

Documentation is available at example_02.php

  1. <?php
  2. /**
  3. * Convert Example #02
  4. *
  5. * This example shows how to convert an image explicitly declaring the type of
  6. * the image disregarding the extension of the "result" image.
  7. *
  8. * @filesource
  9. * @package Asido.Examples
  10. * @subpackage Asido.Examples.Convert
  11. */
  12.  
  13. /////////////////////////////////////////////////////////////////////////////
  14.  
  15. /**
  16. * Include the main Asido class
  17. */
  18. include('./../../class.asido.php');
  19.  
  20. /**
  21. * Set the correct driver: this depends on your local environment
  22. */
  23. asido::driver('gd');
  24.  
  25. /**
  26. * Create an Asido_Image object and provide the name of the source
  27. * image, and the name with which you want to save the file
  28. */
  29. $i1 = asido::image('example.png', 'result_02.jpg');
  30.  
  31. /**
  32. * Save the result as GIF nevertheless we set the result name to be a JPEG one
  33. */
  34. Asido::convert($i1, 'image/gif');
  35.  
  36. /**
  37. * Save the result
  38. */
  39. $i1->save(ASIDO_OVERWRITE_ENABLED);
  40.  
  41. /////////////////////////////////////////////////////////////////////////////
  42.  
  43. ?>

Documentation generated on Mon, 09 Apr 2007 23:57:09 +0300 by phpDocumentor 1.3.0RC4