diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger/persistance')
-rw-r--r-- | src/main/java/de/pixart/messenger/persistance/FileBackend.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/persistance/FileBackend.java b/src/main/java/de/pixart/messenger/persistance/FileBackend.java index 6f7ee3992..be9488205 100644 --- a/src/main/java/de/pixart/messenger/persistance/FileBackend.java +++ b/src/main/java/de/pixart/messenger/persistance/FileBackend.java @@ -1383,7 +1383,10 @@ public class FileBackend { if (bitmap != null || cacheOnly) { return bitmap; } - if (attachment.getMime() != null && attachment.getMime().startsWith("video/")) { + DownloadableFile file = new DownloadableFile(attachment.getUri().getPath()); + if ("application/pdf".equals(attachment.getMime()) && Compatibility.runsTwentyOne()) { + bitmap = cropCenterSquare(getPDFPreview(file, size), size); + } else if (attachment.getMime() != null && attachment.getMime().startsWith("video/")) { bitmap = cropCenterSquareVideo(attachment.getUri(), size); drawOverlay(bitmap, R.drawable.play_video, 0.75f); } else { |