Using PEL (PHP EXIF Library), is there a way to remove the embedded thumbnail from an image's EXIF data?
I am working on a project that resizes images using PHP. This project utilizes PEL to copy EXIF data from the source image to the resized image. However, when resizing images to be really small, the embedded EXIF data contains a thumbnail that is actually much larger than the resized image itself. I would love to use PEL to remove this thumbnail from the EXIF data while keeping al开发者_开发知识库l of the other goodies. Any ideas?
I'm sure there are other ways but the simplest way I can see from here is to read the file in using GD, output a new image and copy the EXIF across. This is by no means a simple process but if you're already doing resizing, it would make some sense.
PEL is a bit stale. If you're doing this on any real scale, you might want to look at playing around with some simple Python scripting. You have access to much better graphics and EXIF libraries and you can cron the script to run on a set period... Though I admit this might not suit your website's image processing flow.
You would need to use an image processing library, imagemagik (imagik) or gmagik would work.
Basically you would grab all of the info you wanted via exif
then use $image -> stripimage()
to remove ALL the meta-data, including the thumbnail, then use gmagic again to take the data you pulled out via exif to add it back in. ($image -> commentimage
for example).
The only catch is that none of the documentation specifies whether the image will be re-added as exif, or some other meta-data type.
精彩评论