Page MenuHomePhabricator

ImageMagick identify uses a lot of memory
Closed, ResolvedPublic

Description

PagedTiffHandler uses ImageMagick identify to get some information about the file, such as the widths and heights of each of the pages. It appears to be extremely memory-inefficient, probably decompressing the whole image. This will cause images to fail to be rescaled, or to fail to upload, once PagedTiffHandler is deployed.

Please consider tiffinfo from libtiff as an alternative.


Version: unspecified
Severity: normal

Details

Reference
bz24821

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:11 PM
bzimport set Reference to bz24821.

I understand the issue, and I'll llook into libtiff for this. However, using identify has one very important advantage: it will fail just in the cases where convert/mogrify will fail. That is, it's a pretty good way to determine which tiff files can actually be rendered, and which can't.

Actually it won't. We use a different shell memory limit on the image scalers compared to the main cluster.

I wasn't talking about failure because of memory limits, but because of unsupported variants of tiff - codecs, etc. there's quite a few of those, check out http://www.libtiff.org/images.html

I added support for libtiff/tiffinfo in r71204, please have a look

marking as fixed, since libtiff/tiffinfo is now used live. Issues with tiffinfo are being tracked by bug 24984.

Gilles raised the priority of this task from Medium to Unbreak Now!.Dec 4 2014, 10:11 AM
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to Medium.Dec 4 2014, 11:23 AM