Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rawler: access all EXIF tags of a raw file #400

Open
RReverser opened this issue Feb 3, 2024 · 3 comments
Open

rawler: access all EXIF tags of a raw file #400

RReverser opened this issue Feb 3, 2024 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@RReverser
Copy link

I'm parsing CR3 files and, among others, need to extract FocalPlaneYResolution.

When I parse it using decode_file(...), the dng_tags field remains unpopulated - I guess it's format-dependant and is only filled for DNG images.

So then I found I can retrieve global decoder and invoke raw_metadata(...) on the file, which is more cumbersome, but at least actually parses the metadata from CR3. Unfortunately, the returned metadata is limited to only some well-known fields and doesn't contain what I need.

Is there any way to get raw list of all tags instead, so that I could extract what I need by EXIF number myself? Maybe dng_tags could be populated for any format upon decoding?

@cytrinox
Copy link
Contributor

cytrinox commented Feb 3, 2024

Access to raw IFDs is problematic, as in newer formats like CR3 there is no "root IFD". In CR3, EXIF tags are spread over CMT1, CMT2 and CMT3 boxes, each forming a separate root IFD.

The recommended solution is to just extend all tags defined by EXIF standard here:

(ExifTag::LensSerialNumber, Value::Ascii(data)) => self.lens_serial_number = data.strings().get(0).map(trim),

Then the requested EXIF attribute can be simply accessed via raw_metadata().

I would be happy reviewing a PR for this 😉

@cytrinox cytrinox added enhancement New feature or request good first issue Good for newcomers labels Feb 3, 2024
@RReverser
Copy link
Author

Access to raw IFDs is problematic, as in newer formats like CR3 there is no "root IFD". In CR3, EXIF tags are spread over CMT1, CMT2 and CMT3 boxes, each forming a separate root IFD.

Yeah I don't need raw IFDs, just raw EXIF values, even if it's after merging all EXIF data from all IFDs.

That in, in the linked branch it could collect any unknown values into a separate HashMap<u16, Value>. That doesn't solve the issue of not getting this info right in dng_tags upon decode_image, but at least provides some way to access the data.

@cytrinox
Copy link
Contributor

cytrinox commented Apr 1, 2024

This should be possible now as IFDs are now accessible #412

@cytrinox cytrinox added this to the 0.6.1 milestone Apr 1, 2024
@cytrinox cytrinox modified the milestones: 0.6.1, 0.6.2 Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants