Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"File D:\drawing.svg" could not be saved." #11

Open
fozzzgate opened this issue May 3, 2022 · 4 comments
Open

"File D:\drawing.svg" could not be saved." #11

fozzzgate opened this issue May 3, 2022 · 4 comments

Comments

@fozzzgate
Copy link

fozzzgate commented May 3, 2022

System: Windows 10 x64
Inkscape Version: 1.1.1

I installed the latest version of inkscape-svgo and get this error ("File D:\drawing.svg" could not be saved."). I used Process Monitor to capture the command line arguments:

"[Path to custom Inkscape extensions directory]\inkscape-svgo.exe" --options=page_1 --precision=2 --pretty=false --enable=sortAttrs=false --multipass=true --enable=cleanupAttrs=true --enable=cleanupEnableBackground=true --enable=cleanupIDs=false --enable=cleanupNumericValues=true --enable=collapseGroups=true --enable=convertColors=true --enable=convertPathData=true --enable=convertShapeToPath=false --enable=convertStyleToAttrs=false --enable=convertTransform=true --enable=mergePaths=true --enable=minifyStyles=true --enable=moveElemsAttrsToGroup=false --enable=moveGroupAttrsToElems=false --enable=removeViewBox=false --enable=removeDimensions=false --enable=removeUnknownsAndDefaults=true --enable=removeUnusedNS=true --enable=removeUselessDefs=true --enable=removeUselessStrokeAndFill=true --enable=removeRasterImages=false --enable=removeScriptElement=false --enable=removeStyleElement=false --enable=removeTitle=true --enable=removeXMLNS=false --enable=removeXMLProcInst=true --enable=removeMetadata=true --enable=removeNonInheritableGroupAttrs=true --enable=removeComments=true --enable=removeDesc=true --enable=removeDoctype=true --enable=removeEditorsNSData=true --enable=removeEmptyAttrs=true --enable=removeEmptyContainers=true --enable=removeEmptyText=true --enable=removeHiddenElems=true D:\Users\[Username]\AppData\Local\Temp\ink_ext_XXXXXX.svgQRO0L1

When I try to run that command in a cmd window and with a real target file, it returns with no output or errors in the command line window. Target file unchanged.

Looking at the ProcMon capture of inkscape-svgo.exe, it calls Windows Error Reporting, so something definitely went wrong:

C:\Windows\system32\WerFault.exe -u -p 2412 -s 560

Unfortunately, inkscape-svgo.exe is a giant black box, so there is seemingly no way to get error data from it. Is there any way to create an unpackaged version for troubleshooting?

@konsumer
Copy link
Owner

konsumer commented May 3, 2022

The source is here and you can run with node. All the options are also essentially options for optimize from svgo library, if you want to instrument the library yourself.

For above, you can run

node inspect inkscape-svgo.js --options=page_1 --precision=2 --pretty=false --enable=sortAttrs=false --multipass=true --enable=cleanupAttrs=true --enable=cleanupEnableBackground=true --enable=cleanupIDs=false --enable=cleanupNumericValues=true --enable=collapseGroups=true --enable=convertColors=true --enable=convertPathData=true --enable=convertShapeToPath=false --enable=convertStyleToAttrs=false --enable=convertTransform=true --enable=mergePaths=true --enable=minifyStyles=true --enable=moveElemsAttrsToGroup=false --enable=moveGroupAttrsToElems=false --enable=removeViewBox=false --enable=removeDimensions=false --enable=removeUnknownsAndDefaults=true --enable=removeUnusedNS=true --enable=removeUselessDefs=true --enable=removeUselessStrokeAndFill=true --enable=removeRasterImages=false --enable=removeScriptElement=false --enable=removeStyleElement=false --enable=removeTitle=true --enable=removeXMLNS=false --enable=removeXMLProcInst=true --enable=removeMetadata=true --enable=removeNonInheritableGroupAttrs=true --enable=removeComments=true --enable=removeDesc=true --enable=removeDoctype=true --enable=removeEditorsNSData=true --enable=removeEmptyAttrs=true --enable=removeEmptyContainers=true --enable=removeEmptyText=true --enable=removeHiddenElems=true YOURSVGFILE

and you will get a nice node-debugger.

@konsumer
Copy link
Owner

konsumer commented May 3, 2022

what version of node are you using?

@maxwxyz
Copy link

maxwxyz commented Aug 8, 2022

Same problem with Inkscape 1.2.1 on Windows 11.

@Polisson
Copy link

Same here. I'm a rookie, but I took the trouble to check debugging.
Windows 10 22H2. Node v20.11.0
Invocation:
node inspect inkscape-svgo.js --options=page_1 --precision=4 --pretty=true --enable=sortAttrs=false --multipass=true --enable=cleanupAttrs=true --enable=cleanupEnableBackground=true --enable=cleanupIDs=false --enable=cleanupNumericValues=true --enable=collapseGroups=true --enable=convertColors=true --enable=convertPathData=true --enable=convertShapeToPath=false --enable=convertStyleToAttrs=false --enable=convertTransform=true --enable=mergePaths=true --enable=minifyStyles=true --enable=moveElemsAttrsToGroup=false --enable=moveGroupAttrsToElems=false --enable=removeViewBox=false --enable=removeDimensions=false --enable=removeUnknownsAndDefaults=true --enable=removeUnusedNS=true --enable=removeUselessDefs=true --enable=removeUselessStrokeAndFill=true --enable=removeRasterImages=false --enable=removeScriptElement=false --enable=removeStyleElement=false --enable=removeTitle=true --enable=removeXMLNS=false --enable=removeXMLProcInst=true --enable=removeMetadata=true --enable=removeNonInheritableGroupAttrs=true --enable=removeComments=true --enable=removeDesc=true --enable=removeDoctype=true --enable=removeEditorsNSData=true --enable=removeEmptyAttrs=true --enable=removeEmptyContainers=true --enable=removeEmptyText=true --enable=removeHiddenElems=true C:\Users\MP0007~1\AppData\Local\Temp\ink_ext_XXXXXX.svgVL30H2

Output:

< For help, see: https://nodejs.org/en/docs/inspector
<
connecting to 127.0.0.1:9229 ... ok
< Debugger attached.
<
Break on start in inkscape-svgo.js:3
  1 #!/usr/bin/env node
  2
> 3 const opts = require('yargs').argv
  4 const { optimize } = require('svgo')
  5 const { readFileSync } = require('fs')
debug>```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants