Commit b047a467 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Restore error dialog when the resulting image size is not even

H264 and H265 codecs cannot handle odd image sizes and just fail.
parent 97402490
......@@ -112,7 +112,7 @@ void AnimaterionRenderer::renderAnimationImpl(KisDocument *doc, KisAnimationRend
* The dialog should endure that the size of the video is even
* The dialog should ensure that the size of the video is even
!((encoderOptions.width & 0x1 || encoderOptions.height & 0x1)
......@@ -123,6 +123,24 @@ void AnimaterionRenderer::renderAnimationImpl(KisDocument *doc, KisAnimationRend
encoderOptions.height = encoderOptions.height + (encoderOptions.height & 0x1);
const QSize scaledSize =
encoderOptions.width, encoderOptions.height,
if ((scaledSize.width() & 0x1 || scaledSize.height() & 0x1)
&& (encoderOptions.videoMimeType == "video/mp4" ||
encoderOptions.videoMimeType == "video/x-matroska")) {
QString m = "Mastroska (.mkv)";
if (encoderOptions.videoMimeType == "video/mp4") {
m = "Mpeg4 (.mp4)";
qWarning() << m <<"requires width and height to be even, resize and try again!";
doc->setErrorMessage(i18n("%1 requires width and height to be even numbers. Please resize or crop the image before exporting.", m));
QMessageBox::critical(0, i18nc("@title:window", "Krita"), i18n("Could not render animation:\n%1", doc->errorMessage()));
const bool batchMode = false; // TODO: fetch correctly!
KisAsyncAnimationFramesSaveDialog exporter(doc->image(),
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