prevent spam logs from ExifInterface via Glide
This commit is contained in:
parent
8c265b6479
commit
8c57970947
1 changed files with 23 additions and 0 deletions
|
@ -0,0 +1,23 @@
|
||||||
|
package deckers.thibault.aves.decoder;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.bumptech.glide.Registry;
|
||||||
|
import com.bumptech.glide.annotation.GlideModule;
|
||||||
|
import com.bumptech.glide.load.resource.bitmap.ExifInterfaceImageHeaderParser;
|
||||||
|
import com.bumptech.glide.module.LibraryGlideModule;
|
||||||
|
|
||||||
|
@GlideModule
|
||||||
|
public class NoExifInterfaceGlideModule extends LibraryGlideModule {
|
||||||
|
@Override
|
||||||
|
public void registerComponents(@NonNull Context context, @NonNull Glide glide, @NonNull Registry registry) {
|
||||||
|
super.registerComponents(context, glide, registry);
|
||||||
|
// prevent ExifInterface error logs
|
||||||
|
// cf https://github.com/bumptech/glide/issues/3383
|
||||||
|
glide.getRegistry().getImageHeaderParsers().removeIf(parser -> parser instanceof ExifInterfaceImageHeaderParser);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue