mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-24 02:39:55 +01:00
Fix some media not appearing in the gallery picker.
Works around the glide issue by using the straight URI when possible, which allows glide to not have to keep a buffer. However, as soon as you select it, it'll be an encrypted file, and we'll run into this same issue where glide needs to keep a buffer for the input stream. Related to #11014
This commit is contained in:
@@ -45,6 +45,7 @@ import org.thoughtcrime.securesms.components.transfercontrols.TransferControlVie
|
||||
import org.thoughtcrime.securesms.database.AttachmentTable;
|
||||
import org.thoughtcrime.securesms.mms.DecryptableStreamUriLoader.DecryptableUri;
|
||||
import org.thoughtcrime.securesms.mms.ImageSlide;
|
||||
import org.thoughtcrime.securesms.mms.PartAuthority;
|
||||
import org.thoughtcrime.securesms.mms.Slide;
|
||||
import org.thoughtcrime.securesms.mms.SlideClickListener;
|
||||
import org.thoughtcrime.securesms.mms.SlidesClickedListener;
|
||||
@@ -483,7 +484,12 @@ public class ThumbnailView extends FrameLayout {
|
||||
|
||||
transferControlViewStub.setVisibility(View.GONE);
|
||||
|
||||
RequestBuilder<Drawable> request = requestManager.load(new DecryptableUri(uri))
|
||||
Object glideModel = uri;
|
||||
if (PartAuthority.isLocalUri(uri)) {
|
||||
glideModel = new DecryptableUri(uri);
|
||||
}
|
||||
|
||||
RequestBuilder<Drawable> request = requestManager.load(glideModel)
|
||||
.diskCacheStrategy(DiskCacheStrategy.NONE)
|
||||
.downsample(SignalDownsampleStrategy.CENTER_OUTSIDE_NO_UPSCALE)
|
||||
.listener(listener);
|
||||
|
||||
Reference in New Issue
Block a user