diff --git a/copyparty/th_cli.py b/copyparty/th_cli.py index 296527f4..9cfef9aa 100644 --- a/copyparty/th_cli.py +++ b/copyparty/th_cli.py @@ -78,16 +78,34 @@ class ThumbCli(object): if rem.startswith(".hist/th/") and rem.split(".")[-1] in ["webp", "jpg", "png"]: return os.path.join(ptop, rem) - if fmt == "j" and self.args.th_no_jpg: - fmt = "w" + if fmt[:1] in "jw": + sfmt = fmt[:1] - if fmt == "w": - if ( - self.args.th_no_webp - or (is_img and not self.can_webp) - or (self.args.th_ff_jpg and (not is_img or preferred == "ff")) - ): - fmt = "j" + if sfmt == "j" and self.args.th_no_jpg: + sfmt = "w" + + if sfmt == "w": + if ( + self.args.th_no_webp + or (is_img and not self.can_webp) + or (self.args.th_ff_jpg and (not is_img or preferred == "ff")) + ): + sfmt = "j" + + vf_crop = dbv.flags["crop"] + vf_th3x = dbv.flags["th3x"] + + if "f" in vf_crop: + sfmt += "f" if "n" in vf_crop else "" + else: + sfmt += "f" if "f" in fmt else "" + + if "f" in vf_th3x: + sfmt += "3" if "y" in vf_th3x else "" + else: + sfmt += "3" if "3" in fmt else "" + + fmt = sfmt histpath = self.asrv.vfs.histtab.get(ptop) if not histpath: diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index f6fbd598..f4f0e05e 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -4944,7 +4944,7 @@ var thegrid = (function () { if (!dcrop.startsWith('f')) return r.setdirty(); - r.crop = dcrop.startsWith('y'); + r.crop = dcrop.endsWith('y'); bcfg_upd_ui('gridcrop', r.crop); if (r.crop != en) toast.warn(10, L.ul_btnlk); @@ -4954,7 +4954,7 @@ var thegrid = (function () { if (!dth3x.startsWith('f')) return r.setdirty(); - r.x3 = dth3x.startsWith('y'); + r.x3 = dth3x.endsWith('y'); bcfg_upd_ui('grid3x', r.x3); if (r.x3 != en) toast.warn(10, L.ul_btnlk);