Wrong units for ImageMagick area limit in policy.xml

Bug #1910980 reported by schmijos
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
imagemagick (Debian)
Fix Released
Undecided
broucaries
imagemagick (Ubuntu)
New
Undecided
Unassigned

Bug Description

This bug originates from Heroku stack images: https://github.com/heroku/stack-images/pull/185

The imagemagick area limits should be pixels and not bytes. The `policy.xml` template uses

  <policy domain="resource" name="area" value="128MB"/>

but should actually be

  <policy domain="resource" name="area" value="128MP"/>

The consequence of this bug is major confusion for people who think that area can only be 128 megabyte but actually can be 1 gigabyte with this limit.

People relying on the output of `identify -list resource` will be confused as well at least, because it will print `Area: 128000000P` if you configured `128MB`.

It's hard to find out, what units we should use for area resource limits because official ImageMagick documentation contradicts itself:
* [ImageMagick _PixelCache_ architecture](https://imagemagick.org/script/architecture.php#:~:text=maximum%20area%20in%20bytes%20of%20any%20one%20image%20that%20can%20reside%20in%20the%20pixel%20cache%20memory.%20If%20this%20limit%20is%20exceeded,%20the%20image%20is%20automagically%20cached%20to%20disk%20and%20optionally%20memory-mapped.)
* [ImageMagick resource limits (environment variables)](https://imagemagick.org/script/resources.php#:~:text=Set%20the%20maximum%20width%20*%20height%20of%20an%20image%20that%20can%20reside%20in%20the%20pixel%20cache%20memory.%20Images%20that%20exceed%20the%20area%20limit%20are%20cached%20to%20disk%20(see%20MAGICK_DISK_LIMIT)%20and%20optionally%20memory-mapped.)
* [`policy.xml` example in source code](https://github.com/ImageMagick/ImageMagick/blob/8ae4ace285a385c5f58b1029f7a4a79925a42853/config/policy.xml#L65)

So without reading code, I simply trust in the format used by `identify -list resource`.

Revision history for this message
broucaries (roucaries-bastien+bugs) wrote :

Fixed in 6.9.11.57

Changed in imagemagick (Debian):
assignee: nobody → broucaries (roucaries-bastien+bugs)
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.