Identify Command with Binary Data ?
Posted: 2009-08-28T10:45:00-07:00
Hello:
I am working on Debian with PHP5 and ImageMagick.
I have a web application where a user submits an image through a form and then the image is re-sized several times. I am able to use the identify command to obtain the original image details as it is written to a temporary file for processing. However, when I convert the main image to other sizes the images will be inserted directly to a MySQL database in a blob field.
I would like to obtain the converted image properties using the identify command. However, I do not want to write each of the converted images to disk solely to obtain the image properties as it would be very slow.
How can I use the identify command in the following manner?
$commandIM = "identify -format '%w %h %b %x %m' {$variable-with-image-binary-data}";
exec ($commandIM, $output);
$info = explode(' ',$output[0]);
From what I have read the identify command can only be used with a file path name... but there must be another way as writing all the files to disk just to obtain the file details and then deleting them would not be efficient by any means.
Thank you.
I am working on Debian with PHP5 and ImageMagick.
I have a web application where a user submits an image through a form and then the image is re-sized several times. I am able to use the identify command to obtain the original image details as it is written to a temporary file for processing. However, when I convert the main image to other sizes the images will be inserted directly to a MySQL database in a blob field.
I would like to obtain the converted image properties using the identify command. However, I do not want to write each of the converted images to disk solely to obtain the image properties as it would be very slow.
How can I use the identify command in the following manner?
$commandIM = "identify -format '%w %h %b %x %m' {$variable-with-image-binary-data}";
exec ($commandIM, $output);
$info = explode(' ',$output[0]);
From what I have read the identify command can only be used with a file path name... but there must be another way as writing all the files to disk just to obtain the file details and then deleting them would not be efficient by any means.
Thank you.