Issue 1:
Glide Version:

4.11

Integration libraries:

No

Device/Android Version:

Mi6, Android 9

Issue details / Repro steps / Use case background:

I'm trying to load images from compressed files.

From the ModelLoader docs:

By default, Glide provides image decoders for two types of data:

InputStream

ByteBuffer

So I think I don't have to add a ModelLoader if I can get an InputStream out of something.

Then I get the InputStream from a zip file object using getInputStream (which is a subclass of InputStream)

private class ZipFileInputStream extends InputStream

But Glide doesn't acknowledge that it is an InputStream.

Glide load line / GlideModule (if any) / list Adapter code (if any):

In fragment:

// From https://github.com/bumptech/glide/issues/1208,
// I think I should use 1 instance of Glide and pass it around
glide = Glide.with(this)

RecyclerView's adapter:

class FolderAdapter(val glide: RequestManager)

and in onBindViewHolder:

CoroutineScope(Dispatchers.IO).launch {
val zis = getZipInputStream()

withContext(Dispatchers.Main) {
glide.load(zis).into(holder.img)
}
}

Layout XML:

<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:cardview="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<!-- No constraint for bottom, as it overrides layout_constraintDimensionRatio -->
<ImageView
android:id="@+id/library_item_folder_cover"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
android:layout_marginTop="0dp"
app:layout_constraintDimensionRatio="H,16:9"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:contentDescription="@string/cover_image_placeholder" />
</androidx.cardview.widget.CardView>

Stack trace / LogCat:

E/GlideExecutor: Request threw uncaught throwable
com.bumptech.glide.Registry$NoModelLoaderAvailableException: Failed to find any ModelLoaders registered for model class: class java.util.zip.ZipFile$ZipFileInflaterInputStream

Issue 2:
Glide Version: 4.0.0-RC1

Integration libraries: No

Device/Android Version: Android 7.0

Issue details / Repro steps / Use case background:

GlideApp.with(context).load(contentStream).into(imageView)

Stack trace / LogCat:

06-21 23:32:21.243 10351-10351/com.pinbox.android.dev E/Glide: class com.bumptech.glide.load.engine.GlideException: Failed to load resource
06-21 23:32:21.243 10351-10634/com.pinbox.android.dev E/GlideExecutor: Request threw uncaught throwable
com.bumptech.glide.Registry$NoModelLoaderAvailableException: Failed to find any ModelLoaders for model: com.amazonaws.services.s3.model.S3ObjectInputStream@62905e5
at com.bumptech.glide.Registry.getModelLoaders(Registry.java:227)
at com.bumptech.glide.load.engine.DecodeHelper.getLoadData(DecodeHelper.java:179)
at com.bumptech.glide.load.engine.DecodeHelper.getCacheKeys(DecodeHelper.java:197)
at com.bumptech.glide.load.engine.ResourceCacheGenerator.startNext(ResourceCacheGenerator.java:41)
at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:282)
at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:249)
at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:222)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:347)

I use AmazonS3Client for get content as input stream of my image.

Finally i have S3ObjectInputStream which extends InputStream

When i try to load my ImputStream to Glide I get error "Failed to find any ModelLoaders"

I guess that i need to implement ModelLoader with S3ObjectInputStream, but this is a bit strange.

Glide doesn't have default InputStream Model Loader ?