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

unable to open large size heif or avif image, please fix it #895

Closed
BHM-Bob opened this issue Feb 4, 2024 · 8 comments
Closed

unable to open large size heif or avif image, please fix it #895

BHM-Bob opened this issue Feb 4, 2024 · 8 comments
Labels
close:wont-fix This will not be worked on codec type:bug Something isn't working

Comments

@BHM-Bob
Copy link

BHM-Bob commented Feb 4, 2024

Describe the bug
无法解码比较大的heif或avif图片。

To Reproduce
打开一个超过1000x1000的heif或avif的图片。

Expected behavior
正常解码

Screenshots
None

System information and logs:
Package: deckers.thibault.aves
Installer: com.android.vending
Aves version: 1.10.3-play, build 112
Flutter: stable 3.16.9
Android version: 13, API 33
Android build: TP1A.220624.014
Device: Xiaomi K50
Support: dynamic colors=true, geocoder=true, HDR=true
Mobile services: ready
System locales: zh_CN
Storage volumes: /storage/emulated/0/
Storage grants: /storage/emulated/0/
Error reporting: false

Additional context
Apple和Xiaomi似乎将一个图片以512x512大小分块储存在heif中,但我需要直接解码一个更大尺寸的heif,这是依赖包的问题还是这个软件的问题呢?

@BHM-Bob BHM-Bob added the type:bug Something isn't working label Feb 4, 2024
@deckerst
Copy link
Owner

deckerst commented Feb 4, 2024

On my device decoding large HEIF works fine, so maybe there's something special with your images or device.

Could you please provide some samples of HEIF and AVIF that fail for you?

@BHM-Bob
Copy link
Author

BHM-Bob commented Feb 4, 2024

some logs

02-05 00:45:57.298 11514 11514 D DecorView[MainActivity]: updateDecorCaptionStatus windowMode is 1
02-05 00:45:58.419 11514 12821 W BpBinder: Slow Binder: BpBinder transact took 2546 ms, interface=android.media.IMediaMetadataRetriever, code=6 oneway=false
02-05 00:45:58.419 11514 12821 E HeifDecoderImpl: decode: videoFrame is a nullptr
02-05 00:45:58.419 11514 12821 D OpenGLRenderer: --- codec->getAndroidPixels() failed.
02-05 00:45:58.425 11514 12821 E HeifDecoderImpl: getSize: not supported!
02-05 00:45:58.442 11514 12821 E HeifDecoderImpl: getSize: not supported!
02-05 00:45:58.444 11514 12821 E HeifDecoderImpl: getSize: not supported!
02-05 00:45:58.541 11514 11562 I flutter : Report log=Nav push to unnamed _PopupMenuRoute<EntrySetAction?>
02-05 00:46:01.102 11514 12821 W BpBinder: Slow Binder: BpBinder transact took 2655 ms, interface=android.media.IMediaMetadataRetriever, code=6 oneway=false
02-05 00:46:01.102 11514 12821 E HeifDecoderImpl: decode: videoFrame is a nullptr
02-05 00:46:01.102 11514 12821 D OpenGLRenderer: --- codec->getAndroidPixels() failed.
02-05 00:46:02.060 11514 11562 I flutter : Report log=Nav pop to /collection
02-05 00:46:03.760 11514 12821 W BpBinder: Slow Binder: BpBinder transact took 2588 ms, interface=android.media.IMediaMetadataRetriever, code=6 oneway=false
02-05 00:46:03.760 11514 12821 E HeifDecoderImpl: decode: videoFrame is a nullptr

@BHM-Bob
Copy link
Author

BHM-Bob commented Feb 4, 2024

On my device decoding large HEIF works fine, so maybe there's something special with your images or device.

Could you please provide some samples of HEIF and AVIF that fail for you?

a cat
https://1drv.ms/u/s!AmTZYQ-SHqYxlQjZrCIXWmVEb3Lk

@deckerst
Copy link
Owner

deckerst commented Feb 4, 2024

There are several possible issues with this particular AVIF sample:

  1. related to size: in Aves large images are tiled to prevent using all the memory. That is, only regions of the images are decoded, instead of the whole picture. But decoding regions is not supported by all decoders. It depends on whatever is shipped with the devices. On my device (and maybe yours too), decoding regions of AVIF is unsupported. I need to find a way to gracefully detect and disable tiling on devices with decoders that don't support it.

  2. unrelated to size: even when I disable tiling, my device fails to decode your sample, even though it can decode other AVIF. Maybe it uses some advance features that are not supported by the codec bundled with Android.

Could you please provide a sample HEIF too?

By the way, some special HDR HEIF created by some Sony cameras fail to load on Android. Maybe that's your case?

@deckerst
Copy link
Owner

deckerst commented Feb 4, 2024

The AVIF you provided can't be decoded with Google Photos or Samsung Gallery either, so I suppose it's just a codec limitation.

I'll take a look at your HEIF samples if you have some.

@BHM-Bob
Copy link
Author

BHM-Bob commented Feb 5, 2024

The AVIF you provided can't be decoded with Google Photos or Samsung Gallery either, so I suppose it's just a codec limitation.

I'll take a look at your HEIF samples if you have some.

same content but in heif. I actually generate these two image from a jpeg using a python package. and it is ok to decode on windows if install HEVC coder.
https://1drv.ms/i/s!AmTZYQ-SHqYxlQldEqZ0Vti0gQIq

@deckerst
Copy link
Owner

deckerst commented Feb 5, 2024

I see. Then it's just these images that are incompatible with the standard Android codecs. Nothing i can do here.

@deckerst deckerst closed this as not planned Won't fix, can't repro, duplicate, stale Feb 5, 2024
@deckerst deckerst added close:wont-fix This will not be worked on codec labels Feb 5, 2024
@BHM-Bob
Copy link
Author

BHM-Bob commented Feb 5, 2024

I see. Then it's just these images that are incompatible with the standard Android codecs. Nothing i can do here.

Okay, thank you for your reply and your works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
close:wont-fix This will not be worked on codec type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants