lclevy / canon_cr3

Describing the Canon CR3 fileformat from Canon M50 / EOS R / SX70 HS / EOS RP...
GNU General Public License v3.0
285 stars 37 forks source link

Wrong definition for records in CTMD box #36

Closed DrCQ closed 1 month ago

DrCQ commented 11 months ago

In your description, each record entry located in the CTMD box has two long values for Record Type (starting at offset 0) and Record Size (starting at 4). For most of the old cameras it is the right assumption, but I found a lot of new cameras (like EOR R3, EOS-1DXmkIII, EOS-R10, EOS-R50, EOS-R6M2, EOS-R7 and EOS-R8) using a different format. For record numbers 7, 8 and 9 these cameras writes [01 01 00 07] instead of [00 00 00 07] etc. For this reason, I suggest to adopt the format definition and split the first value of long into two values of short, where the Record Type is taken from the second value. The first value will be 'unknown' for me.

I'm not using your software but the great CR3 format specification only, and I'm working on my own implementation. If you have any questions or comments, please let me known.

Regards, Christoph

lclevy commented 11 months ago

Could you please offer a patch or delta for the spec ?

DrCQ commented 11 months ago

Here you are (as replacement inside the CTMD box):

For each record (size=8 bytes):

Offset | type | size | content -- | -- | -- | -- 0 | short| 1 | unknown 2 | short| 1 |type. 1,3,4,5,7,8 or 9 4 | long | 1 | size
lclevy commented 1 month ago

fixed in https://github.com/lclevy/canon_cr3/commit/e2db91fc1df56afb887606fb68967ef9f2054408