Closed pmonck closed 1 month ago
This seemed to be a useful addition to api-4, but i am having second thoughts now. Because there are other apis (api-2, api-3) that accept jpeg as input, should they be checked as well (if it is sdr intent jpeg image or ultrahdr image). The documentation clearly states that sdr intent jpeg is to be given as input.
I see what you mean.
However, if there is no warning/error condition raised, I think it would be quite easy for users to unknowingly supply an ultrahdr image as input where an sdr intent jpeg image is required.
Furthermore, without indication to the contrary, my expectation would be for api-4 to replace the gain map from the original ultrahdr input with the one supplied.
Currently, api-4 simply does nothing when the input file contains a gain map and doesn't warn the user that the supplied gain map and metadata have not been applied.
What I'm after is a way to replace existing gain maps and metadata with a new ones. Perhaps we could add a command line option to ignore any existing gain maps in input files? I still think there should be a warning given when the supplied gain map hasn't been applied.
When using ultrahdr_app to encode in scenario 4, if the input jpeg file contains a gain map, then the command simply copies the input file to the output without raising an error condition. The supplied gain map is ignored and not applied to the image.
For example, when using the command : ultrahdr_app -m 0 -i jpegR.jpg -g gainmap.jpg -f metadata.cfg -z UltraHDR.jpg
UltraHDR.jpg is the same as jpegR.jpg if jpegR.jpg already contains a gain map.
I propose that the command should either: a) ignore the gain map in the input file and apply the gain map supplied in the command line to the base image, i.e. UltraHDR.jpg contains the gain map found in gainmap.jpg, not the one found in jpegR.jpg.
Or b) report an error stating that a gain map was found in the input file and that gainmap.jpg has not been applied.
I prefer a) as it provides the useful function of allowing the user to replace an existing gain map with another.