You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const sharp = require('sharp');
sharp("error-svg.svg", {limitInputPixels: false})
.flatten({ background: { r: 255, g: 255, b: 255, alpha: 255 } })
.toColourspace('b-w')
.threshold(255)
.withMetadata({ density: 300 }) // This is only to update the properties. Does not have any impact in SVG rendering.
.tiff({bitdepth:1,compression:'ccittfax4', quality:100, resolutionUnit:'inch'})
.toFile("output.tiff")
.then(function(info) {
console.log(info)
})
.catch(function(err) {
console.log(err)
});
Without limitInputPixels: false it says:
[Error: Input image exceeds pixel limit]
With limitInputPixels: false it says:
(process:8848): librsvg-WARNING **: 11:06:57.559: cannot render on a cairo_t with a failure status (status=InvalidSize)
[Error: svgload: SVG rendering failed
glib: rendering error: InvalidSize
]
For smaller sizes it is working fine.
What is the expected behaviour?
It should convert the large SVG files to TIFF without any error. For error-svg.svg: width="114958" & height="6968".
Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem
listed above
Please provide sample image(s) that help explain this problem
error-svg.svg
The text was updated successfully, but these errors were encountered:
lovell
changed the title
Error while converting large SVG files to TIFF
Improve error messaging when attempting to render SVG > 32767x32767
Mar 30, 2022
Possible bug
Is this a possible bug in a feature of sharp, unrelated to installation?
npm install sharp
completes without error.node -e "require('sharp')"
completes without error.If you cannot confirm both of these, please open an installation issue instead.
Are you using the latest version of sharp?
sharp
as reported bynpm view sharp dist-tags.latest
.If you cannot confirm this, please upgrade to the latest version and try again before opening an issue.
If you are using another package which depends on a version of
sharp
that is not the latest, please open an issue against that package instead.What is the output of running
npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp
?System:
OS: Windows 10 10.0.19042
CPU: (4) x64 Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz
Memory: 2.02 GB / 7.66 GB
Binaries:
Node: 16.13.0 - C:\Program Files\nodejs\node.EXE
npm: 8.1.0 - C:\Program Files\nodejs\npm.CMD
npmPackages:
sharp: ^0.30.3 => 0.30.3
What are the steps to reproduce?
I am using following code to convert SVG to TIFF.
Without
limitInputPixels: false
it says:With
limitInputPixels: false
it says:For smaller sizes it is working fine.
What is the expected behaviour?
It should convert the large SVG files to TIFF without any error. For
error-svg.svg
:width="114958"
&height="6968"
.Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem
listed above
Please provide sample image(s) that help explain this problem
error-svg.svg
The text was updated successfully, but these errors were encountered: