I'm trying to return the following image attributes:
Resolution (in dpi): xxx
Colorspace: xxx
Size (mm): xxx
At the moment I can get the resolution by doing the following:
Code: Select all
<?php echo str_replace(' PixelsPerCentimeter','',round(exec("identify -format %x x %y -units PixelsPerInch $_uploadedFilePath"))) ?>
Also with the colorspace, I can get it to return an integer by the following:
Code: Select all
<?php echo $_image->getImageResolution() ?>
And lastly I can get the dimensions of the image with the following:
Code: Select all
<?php echo exec("identify -format %wx%h $_uploadedFilePath") ?>
I've just installed Imagick after working with exec in PHP and am struggling to get my head around the functions at the moment. Any help at all on the above would be great!
Cheers.