So since i did some diggint about HOW TO detect the DPI for EPS files
saved from adobe photoshop, i thing i should share the info.
The trick is that PS stores the Resolution Info in the 8BIM "data".
So:
convert file.eps file.8bim
if the file.8bim is not empty then we can detect the DPI.
here is some PHP code snippet for doing that:
// $tempfile is the 8bim file
$f=fopen($tempfile, "rb");
$header=fread($f, 4); // 4 bytes 8BIM header
if ($header!="8BIM") { fclose($f); @unlink($tempfile); return false; }
$delim=bin2hex(fread($f, 2));
if ($delim!="03ed") { fclose($f); @unlink($tempfile); return false; }
$hres=bin2hex(fread($f, 4));
$hres_unit=bin2hex(fread($f, 2));
$width_unit=bin2hex(fread($f, 2));
$vres=bin2hex(fread($f, 4));
$vres_unit=bin2hex(fread($f, 2));
$height_unit=bin2hex(fread($f, 2));
$dpi=hexdec($width_unit);
fclose($f);
a helpful resource was:
http://answers.google.com/answers/threadview?id=88091
as for the other formats we're working with: jpg, tif, exiftool does a
wonderful job (fast and precise) !
--
Catalin Constantin
Bounce Software
http://www.bounce-software.com
http://www.cabanova.ro
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users