I have two copies of the same image (jpeg). One is 4.0 MB the other 5.9 MB.
I have run
exiftool -a -G1 -s
and the only difference reported is the size.
hexdump to compare them and they seem to be identical except the second has more data at the end.
They did originally come from an an old Mac and one had extended attributes, including
Does that mean the added data is a resource fork? Is it anything sinister?
I deleted the extended attribute using
xattr -d com.apple.ResourceFork image2.jpg
but that made no difference to the size of the file.
Why are the two files different sizes? I have other files like this. How do I get rid of the junk data at the end of the file?
With some more experimenting I did the following.
sips -s format jpeg image2.jpg --out image0.jpg
reduced the file size to 2MB, but the quality was reduced from 96% to 93%.
sips -f horizontal image2.jpg ; sips -f horizontal image2.jpg
reduced the file size to 2MB (but a tiny bit smaller than image0.jpg), but the quality was reduced from 96% to 93%.
convert image2.jpg image4.jpg
reduced the file size to 3.8MB, the quality was maintained at 96%.
I also noted that opening either original file with Preview caused Finder to add a