deckerst / aves

Aves is a gallery and metadata explorer app, built for Android with Flutter.
BSD 3-Clause "New" or "Revised" License
2.82k stars 106 forks source link

Can't open .HEIC picture #948

Closed sojuo closed 8 months ago

sojuo commented 8 months ago

Describe the bug Images edited by GIMP with the suffix "HEIC" cannot be viewed properly.

To Reproduce Steps to reproduce the behavioor:

  1. Use your smartphone to take a picture of a person sitting in meditation with the suffix "HEIC".
  2. Remove elements other than people from the image in GMIP and export it as an image with the suffix "HEIC".
  3. Viewing exported images on smartphones with Aves.
  4. Can not use Aves to view the image normally, but can be used Image Toolbox for normal editing, and the above image Image Toolbox editing and save the image can be viewed normally in Aves.

Expected behavior The above images edited in GIMP with the suffix "HEIC" can be viewed normally in Aves.

System information and logs: Package: deckers.thibault.aves.libre Installer: com.android.packageinstaller Aves version: 1.10.5-libre, build 11402 Flutter: stable 3.19.1 Android version: 12, API 31 Android build: SKQ1.211006.001 test-keys Device: Xiaomi M2012K11AC Support: dynamic colors=true, geocoder=true, HDR=true Mobile services: not available System locales: zh_CN Storage volumes: /storage/emulated/0/ Storage grants: /storage/emulated/0/Movies/, /storage/emulated/0/Pictures/, /storage/emulated/0/DCIM/, /storage/emulated/0/以前的图片/, /storage/emulated/0/AcFun/, /storage/emulated/0/Android/media/, /storage/emulated/0/tencent/, /storage/emulated/0/邮箱/, /storage/emulated/0/Torrent Client/, /storage/emulated/0/EhViewer/, /storage/emulated/0/AliYunPan/, /storage/emulated/0/screenrecorder/, /storage/emulated/0/BaiduNetdisk/ Error reporting: false

aves-logs-20240316_215557.txt

deckerst commented 8 months ago

HEIC/HEIF decoding depends on the codecs provided by your device, and GIMP may use some advanced HEIC feature/setting that your device codecs can't handle. It's most likely out of scope of Aves itself, but out of curiosity could you please provide a sample image failing on your device?

sojuo commented 8 months ago

HEIC/HEIF decoding depends on the codecs provided by your device, and GIMP may use some advanced HEIC feature/setting that your device codecs can't handle. It's most likely out of scope of Aves itself, but out of curiosity could you please provide a sample image failing on your device?

Pictures.zip Camera_shooting. heic and Edit_with_ImageToobox_after_GIMP.heic can be viewed normally with Aves, but Edited_by_GIMP.HEIC cannot be viewed normally with Aves.

deckerst commented 8 months ago

Thanks for the sample. As I suspected, Gimp is producing HEIC using advanced profile that are not broadly supported. Image Toolbox probably embeds its own HEIC codec, but this is hiding the core issue: the files produced by Gimp won't be openable by most apps.

Camera_shooting. heic:

Edited_by_GIMP.HEIC:

Edit_with_ImageToobox_after_GIMP.heic:

Your camera is producing good HEIC files: 1) low format level (so high compatibility), 2) tiny size, 3) split in small chunks (so nicer for progressive decoding),

Gimp is doing a terrible job: 1) highest format level (so low compatibility), 2) huge size, 3) single big chunk.

Image Toolbox salvage things a little: 1) intermediate format level (level 6 seems well supported these days), 2) back to tiny size, 3) single big chunk for the main file but it also embeds a second useless broken image, so gallery apps that understand HEIC image sequences, like Aves, will show a broken second image.

Anyway, I don't intend to embed my own HEIC codec, as it is silly on Android which already has one. I suggest you fix your workflow to prevent Gimp from generating bad files.