From f009ba6263e55383395ac3afb2335816846b333b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 9 Feb 2023 19:02:12 +0100 Subject: crop-tool: oops, calculate scale from first frame --- anim-crop-tool/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/anim-crop-tool/main.cpp b/anim-crop-tool/main.cpp index 4d0eca1e..6cfaf8aa 100644 --- a/anim-crop-tool/main.cpp +++ b/anim-crop-tool/main.cpp @@ -91,6 +91,11 @@ static bool load_file(anim_group& group, options& opts, anim_atlas_& atlas, Stri } cv::Size size{end - start}; + if (opts.scale.type != anim_scale_type::ratio) + { + float new_width = opts.scale.scale_to_({(unsigned)size.width, (unsigned)size.height})[0]; + opts.scale = {{.r = {new_width / (float)size.width}}, anim_scale_type::ratio}; + } const auto dest_size = fm_begin( auto xy = opts.scale.scale_to({(unsigned)size.width, (unsigned)size.height}); -- cgit v1.2.3