mvysny / photocloud-frame-slideshow

Android Digital Photo Frame
https://www.android-photo-frame.eu
14 stars 1 forks source link

Add support for HEIF image format #92

Closed theQuicker1 closed 5 years ago

theQuicker1 commented 6 years ago

Maybe this isn't possible because of everything the HEIF can contain.

mvysny commented 6 years ago

Looks doable: https://github.com/yohhoy/heifreader Even though I wonder if it's worth the work since Android P will support it natively: https://www.androidcentral.com/android-p-features-we-love-hdr-and-heif-support Can you attach a sample HEIF file please, so that I can test?

mvysny commented 5 years ago

screenshot.heif.zip gimp 2.10 can produce HEIF images also.

mvysny commented 5 years ago

Tried heifreader, unfortunately it failed to read my simple heif file with

java.lang.RuntimeException: A cast to int has gone wrong. Please contact the mp4parser discussion group (4292411352)

Created a bug report: https://github.com/sannies/mp4parser/issues/367

Also the problem is that the heifreader initializes slowly, and decodes file by loading it into memory in its entirety, which is most certainly going to cause OutOfMemoryError.

I'll therefore only enable HEIF support on Android P only, with native Android P loader for now.

mvysny commented 5 years ago

Fixed in 1.13.4

theQuicker1 commented 4 years ago

I was really hoping this would work. Now the people in my family that have iPhones have to go through an extra step to convert their pictures to JPG before they can share them to the photo frame. Thank you for trying though! :)

mvysny commented 4 years ago

Unfortunately I've missed that HEIF image may have .heic extension as well, according to https://fileinfo.com/extension/heic . This will be fixed PhotoCloud 1.13.16.

I also tried the heifreader library again, this time it went further but ultimately failed to read a very simple file produced by Krita: https://github.com/yohhoy/heifreader/issues/8 . However, the initialization speed is not of concern, the library initializes quickly in 281ms on my phone.

The heifreader library also requires Android 21 Lollipop at least.

mvysny commented 4 years ago

Please let me know whether your tablet is Android 21+ and whether the integration with heifreader would be interesting for you.

mvysny commented 4 years ago

Experimental support for HEIF/HEIC added to PhotoCloud 1.13.16. You will need to enable the support in Settings / Filters/Moments / Include HEIF/HEIC in Slideshow . This is only available for Android Lollipop and higher (API 21).