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

HEIF files with 10 bits per channel are not properly decoded #468

Closed
1div0 opened this issue Mar 22, 2021 · 9 comments
Closed

HEIF files with 10 bits per channel are not properly decoded #468

1div0 opened this issue Mar 22, 2021 · 9 comments

Comments

@1div0
Copy link
Contributor

1div0 commented Mar 22, 2021

https://cloud.reflexion.tv/nextcloud/index.php/s/iX3tWnrMGKakTp4 contains some HEIF sample files from Canon EOS R5 and SONY α1

@1div0
Copy link
Contributor Author

1div0 commented Mar 22, 2021

Decoding results
Snímka obrazovky z 2021-03-21 10-14-17
Snímka obrazovky z 2021-03-22 09-36-21

@clanmills
Copy link

Peter

Can you be more specific, please. What are "Some files?". All of them? What is not decoded? Exif? MakerNote?

I've looked one file, and it seems OK.

683 rmills@rmillsm1:~/gnu/github/exiv2/0.27-maintenance/build $ exiv2 -pa ~/Downloads/1C4A5993.HIF | head
Exif.Image.Make                              Ascii       6  Canon
Exif.Image.Model                             Ascii      13  Canon EOS R5
Exif.Image.Orientation                       Short       1  top, left
Exif.Image.XResolution                       Rational    1  72
Exif.Image.YResolution                       Rational    1  72
Exif.Image.ResolutionUnit                    Short       1  inch
Exif.Image.DateTime                          Ascii      20  2021:02:18 19:53:40
Exif.Image.Artist                            Ascii       1  
Exif.Image.YCbCrPositioning                  Short       1  Co-sited
Exif.Image.Copyright                         Ascii       1  
684 rmills@rmillsm1:~/gnu/github/exiv2/0.27-maintenance/build $ tvisitor ~/Downloads/1C4A5993.HIF | head
STRUCTURE OF JP2 (heix) FILE (MM): /Users/rmills/Downloads/1C4A5993.HIF
 address |   length | box  | uuid | data
       0 |       32 | ftyp |      | heix____mif1heixmiaf 104 101 105 120 0 0 0 0 109 105 102 49 104 101 105 120 109 105 97 102
      32 |     2362 | meta |      | _______!hdlr________ 0 0 0 0 0 0 0 33 104 100 108 114 0 0 0 0 0 0 0 0
  STRUCTURE OF JP2 FILE (MM): /Users/rmills/Downloads/1C4A5993.HIF:44->2350
         0 |       33 | hdlr |      | ________pict________ 0 0 0 0 0 0 0 0 112 105 99 116 0 0 0 0 0 0 0 0
        33 |       62 | uuid | cano | ___&CNCVCanonHEIF001 0 0 0 38 67 78 67 86 67 97 110 111 110 72 69 73 70 48 48 49
    STRUCTURE OF JP2 FILE (MM): /Users/rmills/Downloads/1C4A5993.HIF:44->2350:57->46
           0 |       38 | CNCV |      | CanonHEIF001/10.00.0 67 97 110 111 110 72 69 73 70 48 48 49 47 49 48 46 48 48 46 48
    END: /Users/rmills/Downloads/1C4A5993.HIF:44->2350:57->46
685 rmills@rmillsm1:~/gnu/github/exiv2/0.27-maintenance/build $ 

@1div0
Copy link
Contributor Author

1div0 commented Mar 22, 2021

@clanmills metadata are decoded properly, no worries. However, the image content of all 10 bpc files are not handled in the libde265 as can be seen in the log files added.

@clanmills
Copy link

Duuuuhhhh. Stupid me. You've raised this issue on libheif. That explains why you've posted a screen shot.

It's good news that Exiv2 v0.27.4 RC1 is working fine.

@farindk
Copy link
Contributor

farindk commented Mar 22, 2021

I've had a look at the images and indeed they just decode to some almost black noise. However, I cannot see anything special with them and also the thumbnails decode to the same noise.
Are you sure that the images have correct content? We know that libheif actually works fine with HDR images, so at the moment, I tend so say that the images are simply "broken".
Is there any software that can decode these images? Can you send an image how these HIFs should actually look like? For example for the image 1C4A5995.HIF, which at least shows some kind of circles (see attached image, luminance increased manually):
out

@clanmills
Copy link

clanmills commented Mar 22, 2021

I believe those are the images I got from Gordon Laing: https://www.cameralabs.com/jpeg-vs-heif-canon-hif-comparison/

505 rmills@rmillsmm-local:/Users/Shared/Jenkins/Home/userContent/testfiles/Gordon $ ls -lh
total 354520
-rwxrwxrwx  1 rmills  staff    21M 18 Feb 19:53 1C4A5993.CR3
-rwxrwxrwx  1 rmills  staff   7.0M 18 Feb 19:53 1C4A5993.HIF
-rwxrwxrwx@ 1 rmills  staff   6.8M 18 Feb 19:53 1C4A5994.CR3
-rwxrwxrwx  1 rmills  staff   1.0M 18 Feb 19:53 1C4A5994.HIF
-rwxrwxrwx  1 rmills  staff   7.9M 18 Feb 19:54 1C4A5995.CR3
-rwxrwxrwx  1 rmills  staff   1.2M 18 Feb 19:54 1C4A5995.HIF
-rwxrwxrwx  1 rmills  staff    22M 18 Feb 19:55 1C4A5996.CR3
-rwxrwxrwx  1 rmills  staff   8.3M 18 Feb 19:55 1C4A5996.HIF
-rwxrwxrwx  1 rmills  staff    49M 18 Feb 19:55 DSC04337.ARW
-rwxrwxrwx  1 rmills  staff   148K 18 Feb 19:55 DSC04337.HIF
-rwxrwxrwx  1 rmills  staff    49M 18 Feb 19:55 DSC04338.ARW
-rwxrwxrwx  1 rmills  staff   148K 18 Feb 19:55 DSC04338.HIF
-rwxrwxrwx  1 rmills  staff   120K 18 Feb 19:56 DSC04339.HIF
-rwxrwxrwx  1 rmills  staff   120K 18 Feb 19:56 DSC04340.HIF
506 rmills@rmillsmm-local:/Users/Shared/Jenkins/Home/userContent/testfiles/Gordon $ 

Because I'm only interested in the metadata, I asked him to keep the lens cap ON the camera and shoot at the lowest resolution. I added the smallest of those images to the Exiv2 test suite. Exiv2/exiv2#1475 (comment)

@farindk
Copy link
Contributor

farindk commented Mar 22, 2021

@clanmills That sounds like a good explanation.
Sounds like we can close this. Right, @1div0 ?

@1div0
Copy link
Contributor Author

1div0 commented Mar 22, 2021

@farindk thank you for your efforts. Actually, I was not aware how these file were captured. So sorry for the noise. Pun intended.

@farindk
Copy link
Contributor

farindk commented Mar 22, 2021

No problem :-)

@farindk farindk closed this as completed Mar 22, 2021
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

No branches or pull requests

3 participants