Add NoUpscale option

This commit is contained in:
Milan Nikolic
2026-06-24 23:39:03 +02:00
parent 92c49290ae
commit 0439a2edde
10 changed files with 95 additions and 20 deletions
+1
View File
@@ -25,6 +25,7 @@ func options() cbconvert.Options {
opts.Height = iup.GetHandle("Height").GetInt("VALUE")
opts.DPI = dpiValue(iup.GetHandle("DPI").GetAttribute("VALUE"))
opts.Fit = iup.GetHandle("Fit").GetAttribute("VALUE") == "ON"
opts.NoUpscale = iup.GetHandle("NoUpscale").GetAttribute("VALUE") == "ON"
opts.Filter = iup.GetHandle("Filter").GetInt("VALUE") - 1
opts.Quality = iup.GetHandle("Quality").GetInt("VALUE")
switch opts.Format {
+1
View File
@@ -39,6 +39,7 @@ var settings = []setting{
{"NoNonImage", kindBool, "OFF"},
{"Combine", kindBool, "OFF"},
{"Fit", kindBool, "OFF"},
{"NoUpscale", kindBool, "OFF"},
{"Lossless", kindBool, "OFF"},
{"Grayscale", kindBool, "OFF"},
{"OutDir", kindStr, ""},
+2
View File
@@ -359,6 +359,8 @@ func tabImage() iup.Ihandle {
iup.Vbox(
iup.Toggle(" Best Fit").SetHandle("Fit").
SetAttributes(`TIP="Best fit for required width and height"`),
iup.Toggle(" No Upscale").SetHandle("NoUpscale").
SetAttribute("TIP", "Do not enlarge images already smaller than the requested size"),
),
iup.Vbox(
iup.Label("Resize Filter:"),