Page 1 of 1

[Closed] Cocooner creates 2 Kilobytes of seemingly unnecessary padding data

Posted: Thu Apr 21, 2022 6:58 pm
by porg
I compared the original versus the cocooned version of a JPEG file with the help of the binary diff feature of HexFiend and realized the XMP part in the Cocooned file contains a section of 2048 bytes only consisting of whitespace. This has no purpose that I would know of. Just increases the file size.

This doesn't really concern me anymore in the age of TB SSD's. But still at least I wanted to report it:

Cocooner creates 2 Kilobytes unnecessary padding data.png
Cocooner creates 2 Kilobytes unnecessary padding data.png (497.63 KiB) Viewed 1413 times

Re: Cocooner creates 2 Kilobytes of seemingly unnecessary padding data

Posted: Fri Apr 22, 2022 7:21 am
by forum_adm
I write the XMP metadata with the Adobe XMP SDK.

It adds the padding. Also, this is done by design. Please check the official XMP docs. The idea is: an additional change of the XMP metadata has to write only that small part of the file.

Re: [Closed] Cocooner creates 2 Kilobytes of seemingly unnecessary padding data

Posted: Fri Apr 22, 2022 9:46 am
by porg
Thanks for the clarification!

I now learned that the performance benefits certainly far outweigh the negligible storage increase!

Makes sense from an I/O perspective!

The filesystem allocation stays the same, only some minor block overwrite (the 2K align perfectly as a multiple with the filesystem geometry), and no need to allocate new blocks.

For GraphicConverter's batch capabilities this is certainly very meaningful to scale well, e.g. rewriting XMP of 10k files in a jiffy!