react-native-fast-image icon indicating copy to clipboard operation
react-native-fast-image copied to clipboard

is there any plan to support APNG on android?

Open firehand33 opened this issue 4 years ago • 9 comments

firehand33 avatar Apr 28 '20 04:04 firehand33

+1. I desperately need support for APNG; It works perfectly well on iOS, but on Android it's not animating, just plain image. However I don't think it will be fastly available because Glide is currently not supporting APNG: https://github.com/bumptech/glide/issues/1542

junhoyeo avatar Jun 08 '20 09:06 junhoyeo

create ur own loader with glide.

Only-IceSoul avatar Jun 18 '20 01:06 Only-IceSoul

Use this to add Android APNG support to rn-fast-image: https://github.com/penfeizhou/APNG4Android#glide-support

Use https://github.com/ds300/patch-package/ to automate the build.gradle change.

ahmetardal avatar Oct 08 '20 16:10 ahmetardal

Did anyone manage to use what @ardalahmet suggested? I keep stumbling over

Could not GET 'https://www.jitpack.io/com/github/penfeizhou/android/animation/glide-plugin/0.2.16/glide-plugin-0.2.16.pom'. Received status code 401 from server: Unauthorized

when I build my project.

My android/build.gradle has

allprojects {
    repositories {
        ....
        jcenter()
    }
}

and android/app/build.gradle has

dependencies {
    ....
    implementation 'com.github.penfeizhou.android.animation:glide-plugin:0.2.16'
}

I tried without "0.2.16" but got Could not find com.github.penfeizhou.android.animation:glide-plugin:.

I got the version string (0.2.16) from here.

Any ideas?

RobinBobin avatar Feb 26 '21 20:02 RobinBobin

@RobinBobin

You should make the change in rn-fast-image's android/build.gradle file: node_modules/react-native-fast-image/android/build.gradle

maven {
         url "https://maven.google.com"
+        url "https://dl.bintray.com/osborn/Android"
}
dependencies {
     annotationProcessor 'com.android.support:support-annotations:28.0.0-alpha3'
     annotationProcessor "com.github.bumptech.glide:compiler:${_glideVersion}"
     implementation("com.github.bumptech.glide:okhttp3-integration:${_glideVersion}")
+    implementation 'com.github.penfeizhou.android.animation:glide-plugin:2.4.2'
 }

ahmetardal avatar Feb 26 '21 20:02 ahmetardal

Thanks a lot! I'll try it out, if we don't decide to use WebP.

RobinBobin avatar Feb 27 '21 16:02 RobinBobin

Hello!

It does work for me, thanks!

Note: For the animation of animated apng/webp to play, there must be a AppGlideModule in your app. FastImage have one by default. If you set excludeAppGlideModule = true but your app doesn't define one, the animation will never start.

mhammerc avatar Oct 21 '21 14:10 mhammerc

@mhammerc What directions worked for you exactly? I'm having a hard time getting this working. Thanks for any help!

GollyJer avatar Nov 02 '21 01:11 GollyJer

on Android, AAPT cruncher(compress) APNG files, and APNG4Android Gilde plugin might render incorrectly. it happens on android release mode only.

use aapt options on build.gradle to avoid compression. aaptOptions { cruncherEnabled = false }

https://github.com/penfeizhou/APNG4Android/issues/76

update 12.09,

  •    url "https://dl.bintray.com/osborn/Android" 
    

is unnecessary.

StationSoen avatar Nov 15 '21 08:11 StationSoen