Don't upload thumbnails for svg files

This commit is contained in:
Alexander Rosenberg 2024-10-29 05:17:20 -07:00
parent 797615877b
commit e23cbc2ed5
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730

View File

@ -308,7 +308,8 @@ public class LibraryUploadDialog extends JDialog {
} else { } else {
byte[] bytes = md.loadRawBytes(); byte[] bytes = md.loadRawBytes();
rl.addBinaryFile(getPathForAlbum(as.getNameOnDisk()) + ms.getName(), bytes); rl.addBinaryFile(getPathForAlbum(as.getNameOnDisk()) + ms.getName(), bytes);
if (md instanceof ImageMediaData) { // SVG files don't need a thumbnail
if (md instanceof ImageMediaData && !md.getType().startsWith("image/svg")) {
uploadImageThumbnail(state, as, mc, ms, bytes); uploadImageThumbnail(state, as, mc, ms, bytes);
} else if (md instanceof VideoMediaData) { } else if (md instanceof VideoMediaData) {
uploadVideoThumbnail(state, as, mc, ms, (VideoMediaData) md); uploadVideoThumbnail(state, as, mc, ms, (VideoMediaData) md);