Sunday, February 24, 2013

Helpful ImagMagick commands


What to know:
Php programming.
That you are insane enough to tackle photos with php

REFERENCES
// at least it gives you the function lists
http://php.net/manual/en/book.imagick.php 

// nice function list with ACTUAL examples
http://eclecticdjs.com/mike/tutorials/php/imagemagick/imagick_1.php

// nice article on EXIF info (turn off your scriptblocker to see the actual script on the blog site)
http://blog.jmoz.co.uk/imagick-strip-exif-data

For those working with Imagick and its libraries you know how 'well' documented the information is.  Well let's help you out with some valuable functions.

EXIF information
There are several, barely documented features for EXIF data in JPG files.  
$File = '(Name of File)';
$Image = new Imagick($File); 
 
// GET EXIF data 
print_r($Image->getImageProperties ('exif:*')); 
 
// STRIP EXIF data 
$Image->stripImage(); 
 
// WRITE file WITHOUT EXIF data 
$DestFile = 'Fred.jpg';
$Image->writeImage ($DestFile); 
 
// read image data 
$Image->readImage($DestFile); 

// output the data
print_r($Image->getImageProperties('exif:*'));

No comments:

Post a Comment