Page 1 of 2
Memory Allocation failed
Posted: 2017-08-03T19:44:08-07:00
by tuanng
Hello all
Im running the command below
Code: Select all
convert -background transparent -fill "#FFFF3D" -stroke red -strokewidth 1 -font "fonts/impact.ttf" -size 1200x600 -gravity Center -interline-spacing 0 label:ABC 123.png
and im getting the error
Code: Select all
attribute not recognized: D
convert: Memory allocation failed `' @ fatal/draw.c/DrawImage/3110.
But if I run the same command without the stroke options, it works fine.
Code: Select all
convert -background transparent -fill "#FFFF3D" -font "fonts/impact.ttf" -size 1200x600 -gravity Center -interline-spacing 0 label:ABC 123.png
Does anybody know what's going on? It was working fine for a few days then started getting this error
Re: Memory Allocation failed
Posted: 2017-08-03T19:52:34-07:00
by tuanng
actually, taking the 'size' option out also work, but I need the 'size' option to determine text size
Re: Memory Allocation failed
Posted: 2017-08-03T20:06:00-07:00
by snibgo
What version of IM? On what platform?
Re: Memory Allocation failed
Posted: 2017-08-03T21:05:28-07:00
by tuanng
Version: ImageMagick 6.5.9-10 2017-05-26 Q16 - on CENTOS 6.9 x86_64
After a bit more testing, the command with the error worked if I changed the size to 1000x500 ( larger sizes cause errors, I tried 1000x600 too)
Re: Memory Allocation failed
Posted: 2017-08-03T21:17:01-07:00
by fmw42
Your system probably has file size or dimensions limitations.
Re: Memory Allocation failed
Posted: 2017-08-03T22:16:37-07:00
by snibgo
The IM version is very, very old. I suggest you upgrade.
Re: Memory Allocation failed
Posted: 2017-08-03T22:17:44-07:00
by fmw42
snibgo wrote: ↑2017-08-03T22:16:37-07:00
The IM version is very, very old. I suggest you upgrade.
I learned recently, that Linux distros get patches as indicated by the date and do not change the original version number.
I suspect the policy.xml file has limitations set, assuming this is a shared server.
Re: Memory Allocation failed
Posted: 2017-08-03T23:19:43-07:00
by tuanng
This is a dedicated server with 16GB ram
fmw42 wrote: ↑2017-08-03T22:17:44-07:00
snibgo wrote: ↑2017-08-03T22:16:37-07:00
The IM version is very, very old. I suggest you upgrade.
I learned recently, that Linux distros get patches as indicated by the date and do not change the original version number.
I suspect the policy.xml file has limitations set, assuming this is a shared server.
Re: Memory Allocation failed
Posted: 2017-08-03T23:26:25-07:00
by fmw42
See if your policy.xml file has any limitations set. On my Mac IM 6.9.9.4 , it is in /usr/local/etc/ImageMagick-6. See
http://www.imagemagick.org/script/resources.php and
see
http://www.imagemagick.org/source/policy.xml (but you need to view it on a browser that reads xml files into text, such as chrome)
Also check your OS to see if it has any limitations set.
Re: Memory Allocation failed
Posted: 2017-08-05T07:50:04-07:00
by tuanng
Thanks for your reply.
The policy.xml file has all those policies commented out, so I assume it's not active?
Like this..
Code: Select all
<!--
<policy domain="resource" name="memory" value="2GiB"/>
-->
Re: Memory Allocation failed
Posted: 2017-08-05T08:19:29-07:00
by snibgo
What does "convert -list resource" say? Mine says:
Resource limits:
Width: 214.7MP
Height: 214.7MP
Area: 8.4474GP
Memory: 3.9336GiB
Map: 7.8672GiB
Disk: unlimited
File: 1536
Thread: 8
Throttle: 0
Time: unlimited
The first error message is:
tuanng wrote:attribute not recognized: D
This makes me suspect not merely a resource limitation, but something more fundamental, perhaps a bad build of IM (with some patches applied but not others).
Re: Memory Allocation failed
Posted: 2017-08-05T08:23:34-07:00
by tuanng
odd, mine didn't list same as yours, this is what I got
$ convert -list resource
File Area Memory Map Disk Thread Time
-------------------------------------------------------------------------------
768 33.363GB 23.304GiB 62.144GiB 18.446744EB 8 unlimited
Re: Memory Allocation failed
Posted: 2017-08-05T08:44:49-07:00
by snibgo
Yes, that's how it used to look, perhaps more than a year or two ago. Does IM work for you at all? If not, I suggest you re-install. Preferably with a recent version of IM.
Re: Memory Allocation failed
Posted: 2017-08-05T08:55:03-07:00
by tuanng
yes it's working fine except for the memory issue.
The reason I didn't install the latest version is it messed up some commands ( I wrote them a few years ago, so probably not compatible with the new version )
I guess I'll just have to update it and then reinstall
Thanks for your help
Re: Memory Allocation failed
Posted: 2017-08-05T10:29:29-07:00
by snibgo
If you do upgrade, as you have scripts etc, I suggest you upgrade to the latest v6, not v7. V7 has major changes that make porting from v6 non-trivial.