fix: wire -s/-z scale flags and fix format flag handling#1
Open
GobiCowboy wants to merge 1 commit into
Open
Conversation
The -s (output-scale) and -z (model-scale) flags were defined in the CLI but never read or passed to the underlying NCNN binary, making them silently ignored. Additionally, the default format value "ext/png" was passed directly to the binary which rejected it, causing "Invalid output path extension" errors. - Read -s, -c, -t, -m, -f, -x flags in run.go and pass them to Input - Skip passing -f when format is empty or the invalid "ext/png" default - Derive format from input file extension as fallback Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
yashschandra
reviewed
May 2, 2026
| } | ||
| args = append(args, fmt.Sprintf("-m %s", input.ModelPath)) | ||
| if input.SaveImageAs == "" { | ||
| if input.SaveImageAs == "" || input.SaveImageAs == "ext/png" { |
Owner
There was a problem hiding this comment.
Instead of adding a condition here, lets remove the default ext/png set at
Line 45 in c4397f6
| ImageURL: url, | ||
| Model: model, | ||
| OutputPath: outputPath, | ||
| Scale: scaleStr, |
Owner
There was a problem hiding this comment.
We can directly do fmt.Sprintf("%d", outputScale) without defining a new variable to keep code slightly cleaner
| OutputPath: outputPath, | ||
| Scale: scaleStr, | ||
| Compression: fmt.Sprintf("%d", compress), | ||
| TileSize: tileSize, |
Owner
There was a problem hiding this comment.
Unfortunately for this (and other tile size related code) to work, we have to pass the value (not pointer)
upscayl-cli/upscayl/upscayl.go
Line 248 in c4397f6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
-s(output-scale) and-z(model-scale) flags were defined but never read or passed to the NCNN binary, silently ignoring user-specified scale"ext/png"was passed directly to the binary, causingInvalid output path extensionerrors on all runsChanges
-s,-c,-t,-m,-f,-xflags and pass them toupscayl.Input-fwhen format is empty or the invalid"ext/png"default; derive format from input file extension as fallbackTest
🤖 Generated with Claude Code