[ansel] Creating thumbnail from EXIF

Heath S. Hendrickson heath at outerspaceconsultants.com
Fri Jan 9 21:16:10 PST 2004


Okay, so I have this working, but there are some problems that a PHP 
guru might be able to help solve.

1) exif_thumbnail only works on a file, so I only have it working for 
'file' type VFS stores (I added a hack to check this).  I know that I 
could take the image stream and dump it to a temp file, but that seems 
just as wasteful as creating the thumbnail from scratch.
2) the embedded thumbnail may not be accurate depending on if the user 
modified the picture from the original and what application was used 
(rotation, cropping, etc.), so the thumbnail might not be right.

So, why was I wanting to do this?

1) speed.  extracting the embedded thumbnail should be much faster than 
doing the GD manipulations.
2) file size.  The PNG created thumbnails are large (22kb for a 
160x120).  I think that PNG has some serious overhead as I ran an 
unscientific test with ImageMagik's mogrify command and same resolution 
PNG was 2-3x larger than the JPG.   Using Jhead to extract the embedded 
thumbnail resulted in a 7 kb 160x120 JPG file.   Using mogrify with the 
same command created a 35kb PNG and a 12 kb JPG.

Lastly, where does one configure what format the thumbnails are created 
as (PNG vs. JPG).  I'm willing to turn it into a user pref if that's okay.

h


More information about the ansel mailing list