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 load error #1888

Closed
yanxianrui opened this issue Nov 18, 2020 · 9 comments
Closed

heif load error #1888

yanxianrui opened this issue Nov 18, 2020 · 9 comments
Labels

Comments

@yanxianrui
Copy link

yanxianrui commented Nov 18, 2020

some pictures saved by vips_heifsave_buffer can not be loaded by vips_heifload_buffer
error occurs when i use vips copy to transfrom this picture to heif and thumbnail it.

my test file:
1.zip

errors:
xxx$ vips copy 1.jpg 1-80.heif[strip,Q=80]
xxx$ vipsthumbnail 1-80.heif
(vipsthumbnail:26915): VIPS-WARNING **: heifload: ignoring nclx profile
(vipsthumbnail:26915): VIPS-WARNING **: heifload: ignoring nclx profile
(vipsthumbnail:26915): VIPS-WARNING **: heifload: ignoring nclx profile
(vipsthumbnail:26915): VIPS-WARNING **: heifload: ignoring nclx profile
(vipsthumbnail:26915): VIPS-WARNING **: error in tile 0 x 0
(vipsthumbnail:26915): VIPS-WARNING **: error in tile 0 x 0
(vipsthumbnail:26915): VIPS-WARNING **: error in tile 0 x 0
(vipsthumbnail:26915): VIPS-WARNING **: error in tile 0 x 10
(vipsthumbnail:26915): VIPS-WARNING **: error in tile 0 x 20
(vipsthumbnail:26915): VIPS-WARNING **: error in tile 0 x 30
(vipsthumbnail:26915): VIPS-WARNING **: error in tile 0 x 40
(vipsthumbnail:26915): VIPS-WARNING **: error in tile 0 x 50
(vipsthumbnail:26915): VIPS-WARNING **: error in tile 0 x 60
(vipsthumbnail:26915): VIPS-WARNING **: error in tile 0 x 70
(vipsthumbnail:26915): VIPS-WARNING **: error in tile 0 x 80
(vipsthumbnail:26915): VIPS-WARNING **: error in tile 0 x 90
(vipsthumbnail:26915): VIPS-WARNING **: error in tile 0 x 100
(vipsthumbnail:26915): VIPS-WARNING **: error in tile 0 x 110
(vipsthumbnail:26915): VIPS-WARNING **: error in tile 0 x 120
vipsthumbnail: unable to thumbnail 1-80.heif
1-80.heif: bad seek to 93963
1-80.heif: bad seek to 93963
1-80.heif: bad seek to 93963
heifload: bad image dimensions on decode

vips version: 8.12
libheif: 1.9.1
x265: 1.9
libde265: 1.0.2
os: ubuntu 12.04

I'm new to libvips. thanks a lot for any reply.

@jcupitt
Copy link
Member

jcupitt commented Nov 18, 2020

Hello @yanxianrui,

It's working for me:

john@yingna ~/pics $ vips copy 1.jpg 1-80.heif[strip,Q=80]
john@yingna ~/pics $ vipsthumbnail 1-80.heif
john@yingna ~/pics $ 

libheif 1.6.1
libvips 8.11
x265 3.2.1
libde265 1.0.4
ubuntu 20.04

I'm not sure which of your packages you need to update though. Did you mean libvips 8.11? Your ubuntu sounds too old as well. Your x265 seems very old too.

Here's the 1-80.heif that I made:

1-80.heif.zip

If you can vipsthumbnail that I guess the problem must be in your x265.

@yanxianrui
Copy link
Author

sorry it's vips 8.10.2 and thank you for your prompt reply.
I've tried x265 3.3 before but it doesn't work.
I‘II update all my packages to your version to try except my old ubuntu. 😭 I must use it.

@kleisauke
Copy link
Member

I think this is a duplicate of #1808. Since commit strukturag/libheif@c6f7945 (i.e. libheif >= v1.8.0) an odd-sized HEIF file is written with a clap box to crop away the padding border. However, this causes problems when libvips tries to load such images, as it requires that the frame size corresponds with the size specified in the container.

A similar issue can be observed with Google Chrome and libheif-encoded AVIF images smaller than 16×16 pixels (only when libheif is built with aom).

@jcupitt
Copy link
Member

jcupitt commented Nov 19, 2020

Ah, I understand! Sorry Kleis, I've not been following that issue.

I suppose libvips needs a patch for this change?

@kleisauke
Copy link
Member

Probably some additional clipping code needs to be added.

@yanxianrui
Copy link
Author

Hello @jcupitt
I can vipsthumbnail the heif file you made. And no error occurs when I try to use libheif 1.6.1.
thanks a lot for your reply and info.
should I close this question or wait for a patch ?

@jaubourg
Copy link
Contributor

@jcupitt dunno if it's related but I'm getting a: source: bad seek to 1272289 when loading the following heic file: IMG_2631.HEIC.

It's from "the wild" so I have no clue how it was created/saved.

I'm using a custom build with:

  • libde265 1.0.8
  • libheif 1.9.1
  • libvips 8.10.2
  • x265 3.4

I cannot seem to find libvips 8.11 and I'm unable to test with it, was it released some place else than github?

@jcupitt
Copy link
Member

jcupitt commented Nov 24, 2020

Hi @jaubourg, that looks like a different issue. I tried with git master libheif and their heif-convert example reads your file correctly, but libvips fails.

Could you open a new issue please?

@jaubourg
Copy link
Contributor

@jcupitt done! ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants