mirror of
https://github.com/upscayl/upscayl.git
synced 2024-11-12 01:40:53 +01:00
Warn if file output path exceeds Windows's maximum length (#891)
Added check for exceeding MAX_PATH limit in windows. Should be relatively easy to add an actual fix from here. Co-authored by @coderabbit --------- Co-authored-by: Aaron Liu <aaronliu0130@gmail.com>
This commit is contained in:
parent
f5160601e0
commit
4fe8c437d7
@ -57,6 +57,12 @@ const imageUpscayl = async (event, payload: ImageUpscaylPayload) => {
|
||||
|
||||
const isDefaultModel = DEFAULT_MODELS.includes(model);
|
||||
|
||||
// Check if windows can write the new filename to the file system
|
||||
if (outFile.length >= 255) {
|
||||
logit("Filename too long for Windows.");
|
||||
mainWindow.webContents.send(COMMAND.UPSCAYL_ERROR, "The filename exceeds the maximum path length allowed by Windows. Please shorten the filename or choose a different save location.");
|
||||
}
|
||||
|
||||
// UPSCALE
|
||||
if (fs.existsSync(outFile) && !overwrite) {
|
||||
// If already upscayled, just output that file
|
||||
|
Loading…
Reference in New Issue
Block a user