Commit 323ec2c2 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix image proxies not correctly applied after recovering proxy, don't attempt to proxy small images

parent bed54470
Pipeline #269967 passed with stage
in 6 minutes and 38 seconds
......@@ -196,52 +196,55 @@ void ProxyTask::run()
}
QImage proxy;
// Images are scaled to profile size.
// TODO: Make it be configurable?
if (i.width() > i.height()) {
proxy = i.scaledToWidth(KdenliveSettings::proxyimagesize());
} else {
proxy = i.scaledToHeight(KdenliveSettings::proxyimagesize());
}
if (exif > 1) {
// Rotate image according to exif data
QImage processed;
QTransform matrix;
// Images are scaled to predefined size.
int maxSize = qMax(i.width(), i.height());
if (KdenliveSettings::proxyimagesize() < maxSize) {
if (i.width() > i.height()) {
proxy = i.scaledToWidth(KdenliveSettings::proxyimagesize());
} else {
proxy = i.scaledToHeight(KdenliveSettings::proxyimagesize());
}
if (exif > 1) {
// Rotate image according to exif data
QImage processed;
QTransform matrix;
switch (exif) {
case 2:
matrix.scale(-1, 1);
break;
case 3:
matrix.rotate(180);
break;
case 4:
matrix.scale(1, -1);
break;
case 5:
matrix.rotate(270);
matrix.scale(-1, 1);
break;
case 6:
matrix.rotate(90);
break;
case 7:
matrix.rotate(90);
matrix.scale(-1, 1);
break;
case 8:
matrix.rotate(270);
break;
switch (exif) {
case 2:
matrix.scale(-1, 1);
break;
case 3:
matrix.rotate(180);
break;
case 4:
matrix.scale(1, -1);
break;
case 5:
matrix.rotate(270);
matrix.scale(-1, 1);
break;
case 6:
matrix.rotate(90);
break;
case 7:
matrix.rotate(90);
matrix.scale(-1, 1);
break;
case 8:
matrix.rotate(270);
break;
}
processed = proxy.transformed(matrix);
processed.save(dest);
} else {
proxy.save(dest);
}
processed = proxy.transformed(matrix);
processed.save(dest);
result = true;
} else {
proxy.save(dest);
// Image is too small to be proxied
m_logDetails = i18n("Clip type does not support proxies");
result = false;
}
result = true;
m_progress = 100;
QMetaObject::invokeMethod(m_object, "updateJobProgress");
return;
} else {
m_isFfmpegJob = true;
if (!QFileInfo(KdenliveSettings::ffmpegpath()).isFile()) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment