gallery: filter out data: urls

This commit is contained in:
Andrew Dolgov 2017-06-04 08:05:21 +03:00
parent a0d0507631
commit 7e16eb5022

View File

@ -224,8 +224,18 @@ public class GalleryActivity extends CommonActivity {
if (imgSrcFirst.equals(src)) if (imgSrcFirst.equals(src))
firstFound = true; firstFound = true;
item.url = src; try {
item.type = GalleryEntry.GalleryEntryType.TYPE_IMAGE; Uri checkUri = Uri.parse(src);
if (!"data".equals(checkUri.getScheme().toLowerCase())) {
item.url = src;
item.type = GalleryEntry.GalleryEntryType.TYPE_IMAGE;
}
} catch (Exception e) {
e.printStackTrace();
}
} }
if (firstFound && item.url != null) { if (firstFound && item.url != null) {