-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Imagemagick throws "width or height exceeds" when converting SVG to PNG with version 6.9.11-60 but not with 6.9.10-23 #6926
Comments
Naming your input SVG as
... would give a width of 18237 pixels, but your limit in |
Wow. I am stunned. Changed these lines:
to
Now it works. Thanks a thousand! |
When you do
you get and image of dimension 18238 × 2838 So you need a policy that allows for a width of 18238 and height of 2838 and area in pixels of 51,759,444 = 51.8 MP Your policy is Width: 16KP So your width of 16KP = 16,000 is less than the needed width of 18,238 and your area is 128MP which is less than the needed 51.8 MP. You have to allow a density that will keep those dimension below your policy limits, even though you resize afterwards. The limits must allow for intermediate images to satisfy as well as your final image. |
But it is still a mystery why the old ImageMagick version did the SVG to PNG conversion, with the same settings |
There can be 3 different SVG renderers that can be used. Inkscape is best, followed by RSVG delegate. If neither are installed, then the IM internal MSVG/XML renderer is used, which is the least functional. So you may have/had different SVG renderers in use on the two different systems. |
ImageMagick version
6.9.11
Operating system
Linux
Operating system, version and so on
Ubuntu 22.04.3
Description
I have one server with Ubuntu 20.4 and ImageMagick 6.9.10-23.
The newer server is with Ubuntu 22.04.3 LTS and ImageMagick 6.9.11-60.
I upload a SVG file and want to convert it to PNG and resize it.
With the old server it works flawlessly.
The newer server with ImageMagick 6.9.11-60 throws:
I have compared both
/etc/ImageMagick-6/policy.xml
files, they have the same settings. Only the old policy.xml states:And the new one states:
I changed it to
128MB
but still the same error message.I also check with
convert -list resource
. The output is for both servers identical, just the old server statesList length: 18.446744EP
and the new server statesList length: unlimited
.Limits can be seen at the docs. But I use the same file on both servers.
The SVG file is 744 x 1052 pixels.
How to fix this problem?
PS: The problem is NOT the policy.xml - see https://stackoverflow.com/questions/77578848/imagemagick-throws-width-or-height-exceeds-when-converting-svg-to-png-with-ver
The text was updated successfully, but these errors were encountered: