Dear folks,
I'm trying to display information about my images by using Image Magick (the GD Lib version installed on server is too old..). Now, I can show one sentence with little detail using simply 'identify' and the echo the result back to the browser.. However, this doens't seem to work with the -verbose option and the -format option (or any other option) of the 'identify' command... I get nothing for those values while I expect to get a lot of information about my images !! I figure I must have an error in my syntax .. So what the peep am I doing wrong here ???? My goal is to retrieve the height, width and total size of the image and later on also the EXIF information (also using the -format option). Anyways with the 'identify -verbose' command I should get 20+ properties of the images...
My code (in which I test two images, to exclude faulty image problem):
<?php
function info_jpeg ($filename) {
$little_info = exec("identify ".$filename);
echo 'Little info for: '.$filename.'<br>';
echo $little_info.'<br><br>';
$extended_info = exec("identify -verbose ".$filename);
echo 'Extended info for: '.$filename.'<br>';
echo $extended_info.'<br><br>';
$formatinfo_height = exec("identify 'images/ausmap.jpg' -format '%h'");
echo 'Formatted info (height) for: '.$filename.'<br>';
echo 'Height: '.$formatinfo_height.'<br><br>';
}
info_jpeg('images/Foto0321.jpg');
echo '=============================='.'<br><br>';
info_jpeg('images/bullddawg.jpg');
?>
The results in my browser, obviously not what I want:
Little info for: images/Foto0321.jpg
images/Foto0321.jpg JPEG 640x480+0+0 DirectClass 8-bit 55.7k 0.000u 0:01
Extended info for: images/Foto0321.jpg
Elapsed Time: 0:01
Formatted info (height) for: images/Foto0321.jpg
Height:
==============================
Little info for: images/bullddawg.jpg
images/bullddawg.jpg JPEG 96x95+0+0 DirectClass 8-bit 5.4k 0.000u 0:01
Extended info for: images/bullddawg.jpg
Elapsed Time: 0:01
Formatted info (height) for: images/bullddawg.jpg
Height:
Hope someone can help me out !!!
Kind regards,
Roel