piqnt / svgexport

SVG to PNG/JPEG command-line tool and Node.js module
927 stars 85 forks source link

Protocol error: Unable to capture screenshot #94

Open beeryt opened 3 years ago

beeryt commented 3 years ago
  1. Install svgexport
    
    PS C:\> npm i svgexport -g

added 48 packages, and audited 49 packages in 11s found 0 vulnerabilities


2. Run with error (svg from [Fontawesome](https://fontawesome.com/icons/play?style=solid))

PS C:> svgexport .\play-solid.svg .\play-solid.png 64x Error: Protocol error (Page.captureScreenshot): Unable to capture screenshot


Versions

Windows 10.0.18363

npm@7.6.0 node@15.11.0 svgexport@0.4.1

SandroMiccoli commented 3 years ago

Had the same error. Installed using `npm install svgexport -g'.

First a just ran the command without any parameters, and it worked fine.

When trying to export a higher resolution png, I got the error:

$ svgexport.cmd hicetnunc-v0.1.svg hicetnunc-v0.1-25000pixels.png 25000:25000
Error: Protocol error (Page.captureScreenshot): Unable to capture screenshot
shakiba commented 3 years ago

It seems it is a Puppeteer issue because of file size.

beeryt commented 3 years ago

That appears to be correct. I realize now that I used 64x instead of 64:64.

SandroMiccoli commented 3 years ago

It seems it is a Puppeteer issue because of file size.

Is there a way to solve it? Or at least find a way around this issue?

I would like to be able to export high dimensional/quality images.

shakiba commented 3 years ago

Yeah, makes sense. The issue is not specific to svgexport, so if you search for the error on the web you will find some suggestions, for example if you running in a docker container you may be able to fix it by adding more RAM.

Another option/hack might be to export one portion of image at a time using input size parameters, and then merge them together using another tool.

kryztoval commented 3 years ago

I was trying to export the Ghostcript_Tiger.svg in 20x and got this error, but looking at the issues reported here I used version 0.3.2 and it exports correctly. however version 0.4.x does output this error. My computer has 51GB of free ram (64GB installed).