aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-11-14 10:47:48 +0100
committerDanilo M. <danix@danix.xyz>2026-11-14 10:47:48 +0100
commit63b0dd6f4a11a5699caf44574225c3f045c309dc (patch)
tree265f79d8b744d333981b6e9fd0b2d61da1d9ce61
parent14ae5e98e9ccbb48d3f1b5e6fda7d5b88007aca3 (diff)
downloadupscale-qt-master.tar.gz
upscale-qt-master.zip
Suggest the real scale factor in the save nameHEADmaster
The suggested name had _x4 hardcoded. Derive it from the result size. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
-rwxr-xr-xupscale-qt3
1 files changed, 2 insertions, 1 deletions
diff --git a/upscale-qt b/upscale-qt
index db178e0..3a27212 100755
--- a/upscale-qt
+++ b/upscale-qt
@@ -418,8 +418,9 @@ class Main(QMainWindow):
def save_as(self):
job = self.job()
src = Path(job.path)
+ x = round(job.result.width() / job.image.width())
path, _ = QFileDialog.getSaveFileName(
- self, 'Save upscaled image', str(src.with_name(f'{src.stem}_x4{src.suffix}')),
+ self, 'Save upscaled image', str(src.with_name(f'{src.stem}_x{x}{src.suffix}')),
'Images (*.png *.jpg *.jpeg *.webp *.tif *.tiff)')
if not path:
return