paulcpederson / imagemin-newer

Minify images with imagemin only if they need to be updated
MIT License
6 stars 1 forks source link

Crashes on a particular image #2

Open z-x opened 4 years ago

z-x commented 4 years ago

I have a quite simple SVG that crashes when parsed with imagemin-newer. Including the log and the image. Can't really tell where the problem is.

LOG: https://pastebin.com/4DVGtjHP

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Programs\\Other\\Node JS\\node.exe',
1 verbose cli   'C:\\Users\\zx\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'build:img'
1 verbose cli ]
2 info using npm@6.14.5
3 info using node@v12.16.1
4 verbose run-script [ 'prebuild:img', 'build:img', 'postbuild:img' ]
5 info lifecycle secondgate@2020.0.0~prebuild:img: secondgate@2020.0.0
6 info lifecycle secondgate@2020.0.0~build:img: secondgate@2020.0.0
7 verbose lifecycle secondgate@2020.0.0~build:img: unsafe-perm in lifecycle true
8 verbose lifecycle secondgate@2020.0.0~build:img: PATH: C:\Users\zx\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;X:\2020, secondgate\html\node_modules\.bin;C:\Users\zx\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;X:\2020, secondgate\html\node_modules\.bin;C:\Users\zx\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;X:\2020, secondgate\html\node_modules\.bin;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\NVIDIA Corporation\NVIDIA NGX;C:\Programs\Office\Git\cmd;C:\Programs\Other\Node JS\;C:\Programs\Office\VS Code\bin;C:\Users\zx\AppData\Local\Programs\Python\Python38\Scripts\;C:\Users\zx\AppData\Local\Programs\Python\Python38\;C:\Users\zx\AppData\Local\Microsoft\WindowsApps;C:\Users\zx\AppData\Local\Microsoft\WindowsApps;C:\Users\zx\AppData\Roaming\npm;C:\Programs\Internet\Fiddler
9 verbose lifecycle secondgate@2020.0.0~build:img: CWD: X:\2020, secondgate\html
10 silly lifecycle secondgate@2020.0.0~build:img: Args: [ '/d /s /c', 'imagemin-newer ./src/img ./dist/img' ]
11 silly lifecycle secondgate@2020.0.0~build:img: Returned: code: 1  signal: null
12 info lifecycle secondgate@2020.0.0~build:img: Failed to exec build:img script
13 verbose stack Error: secondgate@2020.0.0 build:img: `imagemin-newer ./src/img ./dist/img`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Users\zx\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:311:20)
13 verbose stack     at ChildProcess.<anonymous> (C:\Users\zx\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:311:20)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid secondgate@2020.0.0
15 verbose cwd X:\2020, secondgate\html
16 verbose Windows_NT 10.0.18363
17 verbose argv "C:\\Programs\\Other\\Node JS\\node.exe" "C:\\Users\\zx\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build:img"
18 verbose node v12.16.1
19 verbose npm  v6.14.5
20 error code ELIFECYCLE
21 error errno 1
22 error secondgate@2020.0.0 build:img: `imagemin-newer ./src/img ./dist/img`
22 error Exit status 1
23 error Failed at the secondgate@2020.0.0 build:img script.
23 error This is probably not a problem with npm. There is likely additional logging output     above.
24 verbose exit [ 1, true ]

THE SVG:

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 125.23 40.03"><path d="M0 .01h9v40H0zM11 6.01v34h3.7v-4h1.6v4H20v-34h-9zM22 .01h9v40h-9zM33 .01h9v40h-9zM44 .01h9v40h-9zM61.79 12.25c0 2.11.57 2.93 1.88 2.93s1.91-.74 1.91-2.54a2.39 2.39 0 00-.5-1.71c-.37-.38-.47-.43-2.15-1-2.7-.82-3.76-2.22-3.76-4.92 0-3.26 1.53-5 4.45-5a4.11 4.11 0 014 2.21 6.25 6.25 0 01.56 2.92H65.3c-.12-2-.49-2.64-1.58-2.64s-1.51.8-1.51 2.38c0 1.34.57 2 2.3 2.57a7.1 7.1 0 012.8 1.29c.91.77 1.31 1.92 1.31 3.75 0 3.41-1.66 5.14-4.9 5.14-2.08 0-3.54-.77-4.28-2.28a6.46 6.46 0 01-.57-3.15zM69.68.27h8.52v2.55h-5.33V7.5h4.48v2.51h-4.48v4.83h5.45v2.57h-8.64zM89.4 12.25a6.22 6.22 0 01-.76 3.43 4.47 4.47 0 01-4.14 2 4.56 4.56 0 01-4-1.76c-.62-.88-.87-2.16-.87-4.22V6.06c0-2.33.3-3.63 1.07-4.54A4.63 4.63 0 0184.45.06a4.32 4.32 0 014.19 2.21 6 6 0 01.57 2.92h-2.9c-.15-2-.54-2.64-1.78-2.64s-1.73.87-1.73 3.72v5.21c0 2.84.42 3.7 1.78 3.7s1.85-.82 1.9-2.93zM90.81 5.67c0-4.08 1.44-5.66 5.1-5.66S101 1.59 101 5.67v6.34c0 4.08-1.43 5.67-5.12 5.67s-5.1-1.59-5.1-5.67zm7 .27c0-2.64-.44-3.43-1.9-3.43S94 3.3 94 5.94v5.81c0 2.64.45 3.43 1.94 3.43s1.9-.79 1.9-3.43zM102.86.27H106l4.26 10.93V.27h3v17.14h-3l-4.43-11.06v11.06h-3zM115.31.27h4.38c4-.07 5.62 1.42 5.54 5.24v6.67c.08 3.82-1.51 5.3-5.54 5.23h-4.38zm4.5 14.67c1.83 0 2.21-.58 2.23-3.29V6.01c0-2.71-.4-3.26-2.23-3.28h-1.31v12.21zM64.78 30.39h5v3.09c0 2.35-.24 3.65-.86 4.61a4.72 4.72 0 01-4.26 1.92 4.91 4.91 0 01-4.21-1.75c-.64-.87-.91-2.14-.91-4.23v-5.61c0-2.33.32-3.63 1.11-4.54a5 5 0 013.91-1.46 4.39 4.39 0 014.23 2.2 6.56 6.56 0 01.57 2.93h-2.92c-.15-2-.54-2.64-1.8-2.64-1.47 0-1.91.87-1.91 3.7v5.23c0 2.79.47 3.67 2 3.67s1.91-.88 1.91-3.36v-1.39h-1.86zM74.14 36.36l-.77 3.41h-3.44l5-17.14h2.65l5 17.14h-3.44l-.75-3.41zm2.12-9.53l-1.58 7.08h3.14zM84.43 25.18h-3.12v-2.55h9.43v2.55h-3.12v14.59h-3.19zM92 22.63h8.51v2.55h-5.29v4.68h4.48v2.54h-4.48v4.83h5.44v2.54H92z"/></svg>
paulcpederson commented 4 years ago

This is due to an old bug in svgo https://github.com/svg/svgo/issues/990

Unfortunately I can't really upgrade the versions in this lib due to lack of compatibility with newer versions of imagemin. Honestly I haven't worked on this in a long while. Let me take a look and see if I could upgrade imagemin as I think it would fix this problem.

z-x commented 4 years ago

@paulcpederson - is there any other solution you are using then?