glide icon indicating copy to clipboard operation
glide copied to clipboard

Can a GlideRequest called into by an outer GlideRequest detect the outer target size?

Open ttseattle opened this issue 1 year ago • 0 comments
trafficstars

Hey Sam,

I have a question related to https://github.com/bumptech/glide/issues/5177.

So I have a content provider that makes the following GlideRequest to download a MediaModel as a File.

FutureTarget<File> futureFile = glideRequests.get().download(mediaModel).useUnlimitedSourceGeneratorsPool(true).submit();

There are multiple places in my app, e.g. loading a grid of photos or a full size photo, that each invoke a GlideRequest with a size depending on the required resolution. Each GlideRequest loads a MediaModel, which may trigger this content provider thus invoking a subsequent GlideRequest.

The content provider GlideRequest is loading the File with a size of [-2147483648x-2147483648]. This is unnecessary when the outer Glide request requires a smaller image, and is causing latency in the app.

Is there a way for the content provider to detect the target size of the outer GlideRequest, so that it can request the same size?

ttseattle avatar Jan 09 '24 23:01 ttseattle