Fix video thumbnails for small videos

This commit is contained in:
Nicolas Werner 2024-11-30 02:04:05 +01:00
parent a3219c71d7
commit 2ded62f77d
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -1182,7 +1182,7 @@ MediaUpload::startUpload()
QBuffer buffer(&ba);
buffer.open(QIODevice::WriteOnly);
thumbnail_.save(&buffer, "PNG", 0);
if (ba.size() >= (data.size() - data.size() / 10)) {
if (type() == MediaType::Image && ba.size() >= (data.size() - data.size() / 10)) {
nhlog::ui()->info(
"Thumbnail is not a lot smaller than original image, not uploading it");
nhlog::ui()->debug(