From: Dan F. <da...@co...> - 2009-02-26 05:17:18
|
On Wed, Feb 25, 2009 at 04:02:06PM -0800, Benny Smith wrote: > Would the following approach work for writing new data to the Exif header of > a JPG file: > > Open the JPG file and copy the top 64 KB to RAM. (According to the Exif > Standard, this should capture all of the Exif header). This isn't actually required--libexif contains enough of a parser to extract EXIF data from a .jpg file. It just can't write that data back without help. > Apply the appropriate libexif functions to parse and alter the pertinent > data in the Exif header. > > Write the revised Exif header back into the JPG file starting at the correct > memory address so that the header fits the exact space from which it was > copied earlier. > > Close the JPG file and read it with a commercial Exif header reader. > > This approach would bypass the libjpeg library functions. This would work if the new EXIF block was exactly the same as the old EXIF block. In practise, this is seldom the case because EXIF files often contain dummy data bytes that libexif eliminates, and libexif will also fix malformed data fields which often increases the size (the latter can be disabled). You could probably get this working some of the time, but you'll need to decide if that is acceptable for your application or not. >>> Dan -- http://www.MoveAnnouncer.com The web change of address service Let webmasters know that your web site has moved |