ImageMagick image size limitations?

Author Message

Petter Arneson

Monday 24 October 2005 3:48:39 am

I'm currently working on a picture database, and I get into trouble when the customer publish pictures with size 12-14 mb. The customer uploads images with webdav, that workes fine, but when I browse the gallery it times out. It works fine with smaller images, so I guess the problem lies where ImageMagick tries to genererate the image class used for preview. When I publish only one large image, it takes approx. 60 sec, but when I try publishing two at once it times out.

According to log: "Query error: Lock wait timeout exceeded", and "Transaction in progress failed due to DB error, transaction was rollbacked."

I tried reducing jpeg quality to 50%, then I got errors:

Warning: eZImageShellHandler::convert
Failed executing: /usr/bin/convert '-quality' '50' '-geometry' '205x137' 'var/lha/storage/images/bildegalleri/hv0035/2089-1-nor-NO/hv0035.jpg' 
'JPEG:var/lha/storage/images/bildegalleri/hv0035/2089-1-nor-NO/hv0035_bildethumb.jpg', 
Error: , Return: 9

Error: eZImageManager::createImageAlias
Failed converting var/lha/storage/images/bildegalleri/hv0035/2089-1-nor-NO/hv0035.jpg      to alias original in directory var/lha/storage/images/bildegalleri/hv0035/2089-1-nor-NO

Any ideas?
Is it possible to tweak ImageMagick somehow?

www.vzt.no

Geoff Bentley

Wednesday 27 February 2008 11:57:29 am

I'm getting a similar error, but only for siteaccesses which are clustered, ie storing the storage folders in the database.

Small images seem to work ok (say < 50kb) but anything over brings up the same error:

Warning: eZImageShellHandler::convert  	Feb 27 2008 16:58:51

Failed executing: /usr/bin/convert '-quality' '75' '-geometry' '160x144>' 'var/ezpen/storage/images/users/community_users/ftp/test_ftp/32122-8-eng-NZ/test_ftp.jpg' 'JPEG:var/ezpen/storage/images/users/community_users/ftp/test_ftp/32122-8-eng-NZ/test_ftp_hero.jpg', Error code: 1

Error: eZImageManager::createImageAlias 	Feb 27 2008 16:58:51

Failed converting var/ezpen/storage/images/users/community_users/ftp/test_ftp/32122-8-eng-NZ/test_ftp.jpg to alias 'original' in directory 'var/ezpen/storage/images/users/community_users/ftp/test_ftp/32122-8-eng-NZ'

I've looked around these forums and found little joy in resolving this matter.

Any thoughts, anyone?

Linh Vu

Thursday 28 February 2008 3:12:50 pm

You can try activating ImageMagick warning definitions so you know what's going on with those error codes. There isn't any list of error codes for ImageMagick unfortunately.

Put this in your root .bashrc or whichever shell config you're using:

alias convert='convert -regard-warnings'

Or put that option -regard-warnings in the ezpublish config for ImageMagick (I'm not sure if this will work, but the previous way will definitely work).

If I had more time, I would write less code.

Linh Vu

Thursday 28 February 2008 3:18:35 pm

Btw it could be that ImageMagick is using way too much memory/disk and bombs out as a result. You may want to try setting the limits with this: http://www.imagemagick.org/script/command-line-options.php#limit

If I had more time, I would write less code.

Geoff Bentley

Sunday 02 March 2008 3:11:10 pm

Thanks for that. I don't think the problem is with size limitation, but with clustering. Images stored in the database are not found by imagemagick because it's trying to open the image on the filesystem, rather than through a http request (which would be caught by the Apache config).

I imagine this has been resolved in 4.0? We're currently on 3.9.

cousin mosquito

Tuesday 23 March 2010 8:34:06 pm

In my case it was caused by a clash of ownership after copying image files from one server to another.
In the new install I noticed that any new images uploaded were owned by daemon.

I changed the existing images (which were not loading) to daemon:daemon and the problem went away.

Asking the dumb questions for your benefit

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 00:39:17
Script start
Timing: Jan 31 2025 00:39:17
Module start 'layout'
Timing: Jan 31 2025 00:39:17
Module start 'content'
Timing: Jan 31 2025 00:39:18
Module end 'content'
Timing: Jan 31 2025 00:39:18
Script end

Main resources:

Total runtime0.8428 sec
Peak memory usage8,192.0000 KB
Database Queries70

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0044 588.2578151.2266
Module start 'layout' 0.00440.0033 739.4844220.7188
Module start 'content' 0.00770.8340 960.20314,563.1172
Module end 'content' 0.84170.0010 5,523.320315.8281
Script end 0.8427  5,539.1484 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.3733160.0002
Check MTime0.00120.1442160.0001
Mysql Total
Database connection0.00080.099410.0008
Mysqli_queries0.751489.1580700.0107
Looping result0.00070.0802680.0000
Template Total0.802095.220.4010
Template load0.00180.208720.0009
Template processing0.800294.949220.4001
Template load and register function0.00140.170710.0014
states
state_id_array0.00080.094510.0008
state_identifier_array0.00110.136120.0006
Override
Cache load0.00150.1807360.0000
Sytem overhead
Fetch class attribute can translate value0.00160.193940.0004
Fetch class attribute name0.00190.223090.0002
XML
Image XML parsing0.00370.440140.0009
class_abstraction
Instantiating content class attribute0.00000.0026110.0000
General
dbfile0.00340.4057280.0001
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 26
 Number of unique templates used: 8

Time used to render debug report: 0.0001 secs