Electron: SVG from buffer gives error unsupported image object
See original GitHub issuesharp.format.svg.input[buffer/file/stream] = all true, using sharp 0.18.4 on osx 10.11.6, electron 1.7.5.
Taking the example from the main page:
const roundedCorners = new Buffer(
'<svg><rect x="0" y="0" width="200" height="200" rx="50" ry="50"/></svg>'
);
const roundedCornerResizer =
sharp()
.resize(200, 200)
.overlayWith(roundedCorners, { cutout: true })
.png();
This returns error unsupported input object.
I’m trying something similar in my code - take a jpeg and overlay it with an svg from buffer, but I keep running into this error. Any tips to track down what’s going on here?
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
"Unsupported image object", using Tesseract - Stack Overflow
You are passing the string but not the image itself. To fix it just change the line text = pyt.image_to_string(image_file) to text =...
Read more >Bug listing with status UNCONFIRMED as at 2022/12/28 19 ...
Bug :128538 - "sys-apps/coreutils: /bin/hostname should be installed from coreutils not sys-apps/net-tools" status:UNCONFIRMED resolution: severity:enhancement ...
Read more >Package List — Spack 0.20.0.dev0 documentation
ANTs is popularly considered a state-of-the-art medical image ... It creates control-flow models of each MPI process and, when a failure occurs, ...
Read more >An "Unsupported Image Format" exception occurs on loading ...
svg " in a cxImageList the following error message is displayed: "errormessage.png". So how must an SVG icon be made or exported to...
Read more >System Manual Know-How ecomatmobile CODESYS ... - ifm
CANopen network configuration, status and error handling . ... ifm electronic\CoDeSys V…\Projects\Template_DVD_V… ▻ Open the requested template in CODESYS ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@jpittner, I have had the same problem in Electron. Next solution works for me:
Dependencies:
Closing as there has been no update and no further reports. Please re-open with the requested details if this is still occurring.