Fix disabling autorotate option, add it for images

Fixes #749
parent dc2e00e4
Pipeline #26595 passed with stage
in 10 minutes and 4 seconds
......@@ -996,11 +996,8 @@ void ProjectClip::setProperties(const QMap<QString, QString> &properties, bool r
QStringLiteral("force_aspect_ratio"), QStringLiteral("set.force_full_luma"), QStringLiteral("full_luma"), QStringLiteral("threads"),
QStringLiteral("force_colorspace"), QStringLiteral("force_tff"), QStringLiteral("force_progressive"), QStringLiteral("video_delay")
};
QStringList forceReloadProperties{QStringLiteral("autorotate"), QStringLiteral("templatetext"), QStringLiteral("resource"),
QStringLiteral("force_fps"), QStringLiteral("set.test_image"),
QStringLiteral("video_index")};
QStringList keys{QStringLiteral("luma_duration"), QStringLiteral("luma_file"), QStringLiteral("fade"), QStringLiteral("ttl"),
QStringLiteral("softness"), QStringLiteral("crop"), QStringLiteral("animation")};
QStringList forceReloadProperties{QStringLiteral("autorotate"), QStringLiteral("templatetext"), QStringLiteral("resource"), QStringLiteral("force_fps"), QStringLiteral("set.test_image"), QStringLiteral("video_index"), QStringLiteral("disable_exif")};
QStringList keys{QStringLiteral("luma_duration"), QStringLiteral("luma_file"), QStringLiteral("fade"), QStringLiteral("ttl"), QStringLiteral("softness"), QStringLiteral("crop"), QStringLiteral("animation")};
QVector<int> updateRoles;
while (i.hasNext()) {
i.next();
......@@ -1055,6 +1052,7 @@ void ProjectClip::setProperties(const QMap<QString, QString> &properties, bool r
for (const QString &k : propKeys) {
if (forceReloadProperties.contains(k)) {
refreshPanel = true;
refreshOnly = false;
reload = true;
break;
}
......
......@@ -316,10 +316,10 @@ const char *ClipController::getPassPropertiesList(bool passLength)
{
if (!passLength) {
return "kdenlive:proxy,kdenlive:originalurl,force_aspect_num,force_aspect_den,force_aspect_ratio,force_fps,force_progressive,force_tff,threads,force_"
"colorspace,set.force_full_luma,file_hash,autorotate,xmldata,video_index,audio_index,set.test_image,set.test_audio";
"colorspace,set.force_full_luma,file_hash,autorotate,disable_exif,xmldata,video_index,audio_index,set.test_image,set.test_audio";
}
return "kdenlive:proxy,kdenlive:originalurl,force_aspect_num,force_aspect_den,force_aspect_ratio,force_fps,force_progressive,force_tff,threads,force_"
"colorspace,set.force_full_luma,templatetext,file_hash,autorotate,xmldata,length,video_index,audio_index,set.test_image,set.test_audio";
"colorspace,set.force_full_luma,templatetext,file_hash,autorotate,disable_exif,xmldata,length,video_index,audio_index,set.test_image,set.test_audio";
}
QMap<QString, QString> ClipController::getPropertiesFromPrefix(const QString &prefix, bool withPrefix)
......
......@@ -342,6 +342,19 @@ ClipPropertiesController::ClipPropertiesController(ClipController *controller, Q
connect(timePos, &TimecodeDisplay::timeCodeEditingFinished, this, &ClipPropertiesController::slotDurationChanged);
connect(this, &ClipPropertiesController::updateTimeCodeFormat, timePos, &TimecodeDisplay::slotUpdateTimeCodeFormat);
connect(this, SIGNAL(modified(int)), timePos, SLOT(setValue(int)));
// Autorotate
if (m_type == ClipType::Image) {
int autorotate = m_properties->get_int("disable_exif");
m_originalProperties.insert(QStringLiteral("disable_exif"), QString::number(autorotate));
hlay = new QHBoxLayout;
box = new QCheckBox(i18n("Disable autorotate"), this);
connect(box, &QCheckBox::stateChanged, this, &ClipPropertiesController::slotEnableForce);
box->setObjectName(QStringLiteral("disable_exif"));
box->setChecked(autorotate == 1);
hlay->addWidget(box);
vbox->addLayout(hlay);
}
// connect(this, static_cast<void(ClipPropertiesController::*)(int)>(&ClipPropertiesController::modified), timePos, &TimecodeDisplay::setValue);
}
if (m_type == ClipType::TextTemplate) {
......@@ -1161,6 +1174,8 @@ void ClipPropertiesController::slotEnableForce(int state)
properties.insert(QStringLiteral("force_aspect_den"), QString::number(spin2->value()));
properties.insert(QStringLiteral("force_aspect_num"), QString::number(spin->value()));
properties.insert(QStringLiteral("force_aspect_ratio"), QString::number((double)spin->value() / spin2->value(), 'f'));
} else if (param == QLatin1String("disable_exif")) {
properties.insert(QStringLiteral("disable_exif"), QString::number(1));
}
}
if (properties.isEmpty()) {
......
Markdown is supported
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