"Why is my file smaller after I use ExifTool to write information?"
There are various specific reasons why this can happen, but the general answer is: When ExifTool writes an image, the meta information may be restructured in such a way that it takes less space than in the original file.
For instance, the EXIF/TIFF standard allows for blocks of unreferenced data to exist in an image. Some digital cameras write JPEG or TIFF-based RAW files which contain large blocks of unused data, usually filled with binary zeros. The reason for this could be to simplify camera algorithms by allowing variable-sized information to be written at fixed offsets in the output image. When ExifTool rewrites an image it does not copy these unused blocks. This can result in a significant reduction in file size for some images. [The -htmlDump option may be used to view the file structure if you are interested in seeing these unused data blocks -- use a command like "exiftool -htmlDump a.jpg > out.html", then open the output HTML file with your web browser.]
Also, the size of an XMP record may easily shrink or grow when it is rewritten, even if no meta information is changed. This is partly due to the fact that the XMP specification recommends a few KB of padding at the end of the record (ExifTool adds 2424 bytes by default), and partly due to the flexibility of the XMP format which allows the information to be written in various styles, some of which are more compact than others.
You may also notice that the values of some "offset" tags (like ThumbnailOffset and PreviewImageStart) may change when the file is rewritten. This is normal, and simply indicates that the associated data is now stored at a different position within the file.
ExifTool does not modify the image data itself, so editing a file is "lossless" as far as the image is concerned.
Skontaktuj się z nami