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
Dng fixes #285
Merged
Merged
Dng fixes #285
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But you do - it's called TIFF/EP (which DNG extends if you've read the spec carefully, as do other raw containers like NEF) and these tags go straight into IFD0 and replicate most of Exif tags. Everything is in these two specs:
http://www.barrypearson.co.uk/top2009/downloads/TAG2000-22_DIS12234-2.pdf
https://helpx.adobe.com/content/dam/help/en/photoshop/pdf/dng_spec_1_6_0_0.pdf
So typically DNGs don't have an ExifIFD unless there are really some other tags needed that don't exist in TIFF/EP+DNG. Usually you just have IFD0 w/ preview and all the metadata, and SubIFD w/ the raw image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks for that information. In fact I do seem to remember trying to get it to accept those tags in IFD0 but I never got it to work. I always got "unknown tag" errors, unless I was putting them in the EXIFID. Do you know if libtiff supports this feature? Perhaps libtiff isn't the best library to use, do you know of any alternatives? Thanks again!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, haven't tried that in a while, might be a problem indeed. Perhaps that's best raised w/ libtiff as an unnecessary limitation.
As a workaround, you could close the file w/o these "Exif" specific tags w/ libtiff, then add them via
exiv2
library API to the Exif.Image directory (i.e. IFD0), rather than Exif.Photo (ExifIFD). (There is alsolibexif
which might be lighter but don't know if it'll do the job...)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, I've found writing DNG files in C/C++ to be unreasonably difficult. Given that dcraw, RawTherapee, DarkTable and the Python libraries we use in our own software all seem to accept them, I'm not very keen to spend more time on it. Moving forwards we're going to be making ever more use of Picamera2 which supports DNG using the PiDNG Python library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use the Adobe DNG SDK then, perhaps that is easier...
In any case, requested w/ libtiff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for submitting that, let's see what happens!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davidplowman The PiDNG description at https://github.com/schoolpost/PiDNG kind of implies it should have generic DNG support, any reason it was named PiDNG as opposed to PyDNG?
Thanks for mentioning that, it looks like it might be the solution to some of my headaches of writing DNGs from Python after reading raw data with rawpy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the PiDNG library was originally for the Pi but it has expanded since. You'd have to check with the author who has no affiliation with Raspberry Pi but has very generously been happy to help us make use of his work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it went the other way for some reason: https://github.com/schoolpost/PyDNG