google / libultrahdr

Ultra HDR is a true HDR image format, and is backcompatible. libultrahdr is the reference codec for the Ultra HDR format. The codecs that support the format can render the HDR intent of the image on HDR displays; other codecs can still decode and display the SDR intent of the image.
https://developer.android.com/guide/topics/media/platform/hdr-image-format
Apache License 2.0
142 stars 24 forks source link

Error decoding: "encountered error while parsing metadata" #116

Closed gregbenz closed 4 days ago

gregbenz commented 4 months ago

I'm seeing an error ("encountered error while parsing metadata") when using the following command to decode sample JPGs from Adobe: ultrahdr_app -m 1 -j 04.jpg

Sample images may be found at https://helpx.adobe.com/camera-raw/using/gain-map.html.

Perhaps due to RGB map encoding with these images?

DichenZhang1 commented 4 months ago

Hi Greg,

The gain map format has updated on the Adobe side. We'are actively working on updating the library accordingly.

Thanks!

gregbenz commented 4 months ago

@DichenZhang1 Great, thank you!

GrousexyHKCN commented 1 month ago

hi guys, just want to check whether the decoding can be accessible now; i have try ultrahdr_app -m 1 -j 04.jpg the same image as greg used from adobe, but reports xml parse error, could not find attribute hdrgm:Version

GrousexyHKCN commented 1 month ago

i have successfully decode ultra hdr jpeg(create by encode scenario 4 :ultrahdr_app -m 0 -i input_sdr.jpg -g input_gain.jpg -f metadata.cfg). but the output make me feel confused, when i use -z out.heic, the out.heic image can not be read by any photo app or browser, so the output format can only be decoded to .raw file as the -z default right? and the default output output.raw is recognized as Panasonic raw image but can not be convert by Adobe DNG converter. can someone give a sample how can i handle with the output.raw file?

Jul 8: found the answer in https://github.com/google/libultrahdr/issues/54#issuecomment-1873290209 Whether rgba1010102 in the options description can be replaced by x2bgr10le?

ram-mohan commented 1 month ago

With reference to comment "xml parse error, could not find attribute hdrgm:Version"

The problem is while parsing the gainmap metadata, it sees that metadata contains, separate gainmap min, max, lambda for r, g and b. Currently the library handles same values for all channels. As a result parsing is stopped mid way and this manifests as "xml parse error, could not find attribute hdrgm:Version".

Once separate metadata for each channel is handled, this can be closed.

JohnnyShixy commented 2 weeks ago

大家好,我只是想检查一下现在是否可以解码; 我尝试了ultrahdr_app -m 1 -j 04.jpg与 greg 使用的 adobe 相同的图像,但报告xml parse error, could not find attribute hdrgm:Version

Hi, I'm curious if this issue has been solved, I saw the following comments but I didn't understand. "xml parse error, could not find attribute hdrgm:Version"

GrousexyHKCN commented 2 weeks ago

Hi, I'm curious if this issue has been solved, I saw the following comments but I didn't understand. "xml parse error, could not find attribute hdrgm:Version"

i think it is due to the lack of parsing multi-channel support for gainmap metadata, if you use the adobe demo to check the ultrahdr photo then selecting the gainmap option, you would see a colorful gainmap(with rgb channel) which did not support by libultrahdr now. As ram said above Once separate metadata for each channel is handled, this can be closed.

JohnnyShixy commented 2 weeks ago

Hi, I'm curious if this issue has been solved, I saw the following comments but I didn't understand. "xml parse error, could not find attribute hdrgm:Version"

i think it is due to the lack of multi-channel support for gainmap, if you use the adobe demo to check the ultrahdr photo then selecting the gainmap option, you would see a colorful gainmap(with rgb channel) which did not support by libultrahdr now. As ram said above Once separate metadata for each channel is handled, this can be closed.

ic, thanks for your reply. I find that when encoding, there is “-M select multi channel gain map, optional. [0:disable (default), 1:enable]” in libultrahdr. Is this function currently working?

GrousexyHKCN commented 2 weeks ago

Hi, I'm curious if this issue has been solved, I saw the following comments but I didn't understand. "xml parse error, could not find attribute hdrgm:Version"

i think it is due to the lack of multi-channel support for gainmap, if you use the adobe demo to check the ultrahdr photo then selecting the gainmap option, you would see a colorful gainmap(with rgb channel) which did not support by libultrahdr now. As ram said above Once separate metadata for each channel is handled, this can be closed.

ic, thanks for your reply. I find that when encoding, there is “-M select multi channel gain map, optional. [0:disable (default), 1:enable]” in libultrahdr. Is this function currently working?

that works for encoding, i successfully encode 3-channel gainmap into ultrahdr image.

image
DichenZhang1 commented 2 weeks ago

Hi @JohnnyShixy

The decoding failure is due to 3-channel gain map and XML metadata. In this version the decoding side only supports limited feature for 3-channel gainmap with XML metadata (i.e. when all 3 channel metadata is identical). The input from Adobe is using 3-channel gainmap and XML metadata and currently it is not supported by the library.

As we are planning to move everything to ISO standard instead of XML, currently there is no plan to add full support for 3-channel gainmap with XML metadata. However, with ISO metadata full feature for both single channel and 3-channel gainmap will be supported. Currently this feature is hidden under feature flag "kWriteIso21496_1Metadata".

The "-M" command is used on the encoder side, for encoding 3-channel gainmap.

JohnnyShixy commented 2 weeks ago

Hi @JohnnyShixy

The decoding failure is due to 3-channel gain map and XML metadata. In this version the decoding side only supports limited feature for 3-channel gainmap with XML metadata (i.e. when all 3 channel metadata is identical). The input from Adobe is using 3-channel gainmap and XML metadata and currently it is not supported by the library.

As we are planning to move everything to ISO standard instead of XML, currently there is no plan to add full support for 3-channel gainmap with XML metadata. However, with ISO metadata full feature for both single channel and 3-channel gainmap will be supported. Currently this feature is hidden under feature flag "kWriteIso21496_1Metadata".

The "-M" command is used on the encoder side, for encoding 3-channel gainmap.

Thank you for your great explanation, I understand.