gif: corrected the wrong aspect ratio scaling.

This commit is contained in:
Hermet Park 2023-11-06 19:56:27 +09:00
parent 99b57dc2b8
commit 8a5d14c6b5

View file

@ -220,7 +220,11 @@ public:
return false;
}
animation->picture()->size(width, height);
//keep the aspect ratio.
float ow, oh;
animation->picture()->size(&ow, &oh);
float scale = static_cast<float>(width) / ow;
animation->picture()->size(ow * scale, oh * scale);
auto saver = Saver::gen();
if (!saver) {