Skip to content

Conversation

@ram-mohan
Copy link
Contributor

This change provides an option to print gainmap metadata without completely decoding the image.

fixes #362

Test: ./ultrahdrapp -m 1 -j out.jpeg -P

@gregbenz
Copy link

@ram-mohan Would you consider this a fairly good test to see if a file is likely a gain map? It would be very nice to have an option to simply validate in some performant way. I wouldn't expect it to catch bit rot or image encoding errors since it isn't decoding fully.

@ram-mohan
Copy link
Contributor Author

@gregbenz probe() is the first stage of decoding process. In this stage, the application checks for presence of primary image, gainmapimage and gainmap metadata. If these are present then the application continues decoding. So i think this is a good starting point to check if the image is a valid uhdr image.

@gregbenz
Copy link

gregbenz commented Sep 1, 2025 via email

@ram-mohan
Copy link
Contributor Author

It is added under option P,
./ultrahdrapp -m 1 -j out.jpeg -P will give results.

@gregbenz
Copy link

gregbenz commented Sep 1, 2025

Great!

Is this supported to just probe (test if file is valid or not) without creating a new raw file?
./ultrahdrapp -j out.jpeg -P

I would generally assume the goal for using probe is just a test and not output (as requesting normal decode would be expected to throw an error if the target source image is not a valid gain map).

@ram-mohan
Copy link
Contributor Author

yes

This change provides an option to print gainmap metadata without
completely decoding the image.

fixes google#362

Test: ./ultrahdrapp -m 1 -j out.jpeg -P
@DichenZhang1 DichenZhang1 merged commit bdfdef4 into google:main Sep 5, 2025
20 checks passed
@ram-mohan ram-mohan deleted the probe branch September 5, 2025 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request: add option in CLI (demo app) to validate a source file as a supported gain map

3 participants