32 lines
1.0 KiB
Java
32 lines
1.0 KiB
Java
package com.bumptech.glide.load.resource.gif;
|
|
|
|
import android.util.Log;
|
|
import com.bumptech.glide.load.EncodeStrategy;
|
|
import com.bumptech.glide.load.Options;
|
|
import com.bumptech.glide.load.ResourceEncoder;
|
|
import com.bumptech.glide.load.engine.Resource;
|
|
import com.bumptech.glide.util.ByteBufferUtil;
|
|
import java.io.File;
|
|
import java.io.IOException;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class GifDrawableEncoder implements ResourceEncoder<GifDrawable> {
|
|
@Override // com.bumptech.glide.load.ResourceEncoder
|
|
public EncodeStrategy a(Options options) {
|
|
return EncodeStrategy.SOURCE;
|
|
}
|
|
|
|
@Override // com.bumptech.glide.load.Encoder
|
|
public boolean a(Resource<GifDrawable> resource, File file, Options options) {
|
|
try {
|
|
ByteBufferUtil.a(resource.get().b(), file);
|
|
return true;
|
|
} catch (IOException e) {
|
|
if (Log.isLoggable("GifEncoder", 5)) {
|
|
Log.w("GifEncoder", "Failed to encode GIF drawable data", e);
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
}
|