diff --git a/library/src/main/java/com/bumptech/glide/load/resource/transcode/TranscoderRegistry.java b/library/src/main/java/com/bumptech/glide/load/resource/transcode/TranscoderRegistry.java index 18bd05f16d..7802604115 100644 --- a/library/src/main/java/com/bumptech/glide/load/resource/transcode/TranscoderRegistry.java +++ b/library/src/main/java/com/bumptech/glide/load/resource/transcode/TranscoderRegistry.java @@ -60,6 +60,7 @@ public synchronized ResourceTranscoder get( } @NonNull + @SuppressWarnings("unchecked") public synchronized List> getTranscodeClasses( @NonNull Class resourceClass, @NonNull Class transcodeClass) { List> transcodeClasses = new ArrayList<>(); @@ -70,8 +71,9 @@ public synchronized List> getTranscodeClasses( } for (Entry entry : transcoders) { - if (entry.handles(resourceClass, transcodeClass)) { - transcodeClasses.add(transcodeClass); + if (entry.handles(resourceClass, transcodeClass) + && !transcodeClasses.contains((Class) entry.toClass)) { + transcodeClasses.add((Class) entry.toClass); } }