I want to resize the gif file and save it. I tried to use some suggested methods but those give error and later I came to know that some of methods are deprecated in Glide v4
byte[] bytes = Glide.with(context)
.asGif()
.load(url)
.toBytes()
.into(250, 250)
.submit()
.get();
In above code converting the arrays to file gives blank gif file with 4.x MB size
File file = Glide.with(reactContext)
.asFile()
.load(url)
.override(512, 512)
.fitCenter()
.into(512,512)
.get();
And
File file = Glide.with(reactContext)
.asFile()
.load(url)
.apply(new RequestOptions().override(512, 512))
// .diskCacheStrategy(DiskCacheStrategy.ALL)
.submit(512,512)
.get();
And
File file = Glide.with(reactContext)
.asFile()
.load(url)
// .override(512, 512)
.fitCenter()
.submit(512,512)
.get();
But the above code keeps the width and height as it is
Details:
Glide version : 4.13.0
Please share the proper code or suggest something to resize the gif (to save as file rather displaying).
implementation 'com.github.bumptech.glide:glide:4.13.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.0'
– Aculeate