问题
I am trying to edit jpeg marker data (eg: exif data) in APP0 section. I used libjpeg to decompress the source file to get exif data and uncompressed image data. I used libexif to modify exif data. Then I compressed the source image data and modified exif data to create a new jpeg file.
Instead of doing decompressing and compressing again, I am wondering if there is any way to edit JPEG metadata without re-compressing the original image?
(Looks like, I can call jpeg_write_header or jpeg_write_marker only after jpeg_start_compress and before jpeg_write_scanlines function calls. Can I tell the compressor that source data is already compressed and we just want to update/write the header/marker information).
来源:https://stackoverflow.com/questions/10508410/is-there-any-easy-way-to-edit-jpeg-marker-data-in-place