Black image output when memory limit is set

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
gaurnitai74
Posts: 13
Joined: 2013-04-04T03:30:30-07:00
Authentication code: 6789

Black image output when memory limit is set

Post by gaurnitai74 »

Hi,
We find some regression error with the latest IMagick 6.9.2-4

When we specify [memory, map, area] limits while converting CMYK colorspace PDFs to RGB then the output result is a black image(we are using Ghostscript 9.06 due to licensing limitations).
convert.exe Janmashtami.pdf -limit memory 2MB -limit map 4MB -limit area 8MB -quality 80 -strip -filter Lanczos -colorspace RGB -resize 1280x1280 Janmashtami-286981799.jpg
When we remove the 3 limits then the output is fine. Please let us know if this can be fixed.
Thanks & Regards,
Vimal
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Black image output when memory limit is set

Post by dlemstra »

Can you share your PDF file and tell us your operating system? What are the dimensions of your image?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
gaurnitai74
Posts: 13
Joined: 2013-04-04T03:30:30-07:00
Authentication code: 6789

Re: Black image output when memory limit is set

Post by gaurnitai74 »

Thanks for your response. Please find the link to a sample file:
https://temp-share.com/f/frwktjumvf
https://temp-share.com/f/xfrwktzfxx

OS: Windows Server 2008 R2
gaurnitai74
Posts: 13
Joined: 2013-04-04T03:30:30-07:00
Authentication code: 6789

Re: Black image output when memory limit is set

Post by gaurnitai74 »

Hi,
Were you able to reproduce the issue?
Thanks in advance,
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Black image output when memory limit is set

Post by dlemstra »

I can reproduce the issue. The limits are probably to low, I will take a look again at it this weekend.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Black image output when memory limit is set

Post by magick »

The conversion works for us under Linux. What happens if you save to PNG rather than JPEG? If that works try adding
  • -define jpeg:optimize-coding=true
to your command-line. Did that help?
gaurnitai74
Posts: 13
Joined: 2013-04-04T03:30:30-07:00
Authentication code: 6789

Re: Black image output when memory limit is set

Post by gaurnitai74 »

Hi,
Thank you for the response. We find that this worked fine in 6.8.8-10. We hit this issue when migrating to the latest version 6.9.2-4. This issue occurs even with some jpg images as small as 90kb. I will share it as well for your reference.
Thanks in advance,
gaurnitai74
Posts: 13
Joined: 2013-04-04T03:30:30-07:00
Authentication code: 6789

Re: Black image output when memory limit is set

Post by gaurnitai74 »

magick wrote:The conversion works for us under Linux. What happens if you save to PNG rather than JPEG? If that works try adding
  • -define jpeg:optimize-coding=true
to your command-line. Did that help?
PNG output works fine but the above code did not help. We need jpg output. As I mentioned, this works fine in 6.8.8, so something has broken.
Thank you,
gaurnitai74
Posts: 13
Joined: 2013-04-04T03:30:30-07:00
Authentication code: 6789

Re: Black image output when memory limit is set

Post by gaurnitai74 »

Black output when limits are set.

https://temp-share.com/f/cxfrwklioc

convert.exe city.JPG[0] -limit memory 2048 -limit map 4096 -limit area 8192 -quality 80 -strip -filter Lanczos -profile "sRGB Color Space Profile.icm" -colorspace RGB -resize 640x480 city768088308.jpg
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Black image output when memory limit is set

Post by fmw42 »

Your command and image works fine for me on IM 6.9.2.4 Q16 Mac OSX SnowLeopard

Code: Select all

convert city.JPG[0] -limit memory 2048 -limit map 4096 -limit area 8192 -quality 80 \
-strip -filter Lanczos -profile /Users/fred/images/profiles/sRGB.icc -colorspace RGB \
-resize 640x480 city768088308.jpg
Note I used my sRGB.icc profile rather than your .icm one. I do not know if this might be the issue or not. see http://www.color.org/srgbprofiles.xalter

Or perhaps this is a Windows only issue?
gaurnitai74
Posts: 13
Joined: 2013-04-04T03:30:30-07:00
Authentication code: 6789

Re: Black image output when memory limit is set

Post by gaurnitai74 »

Hello,
Thanks for the response. I removed -profile & .icm profile altogether but the black jpg output persists.

Code: Select all

convert city.JPG[0] -limit memory 2048 -limit map 4096 -limit area 8192 -quality 80 -strip -filter Lanczos -colorspace RGB -resize 640x480 city768088308.jpg
Best Regards
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Black image output when memory limit is set

Post by snibgo »

On Windows 8.1, IM 6.9.1-6, I get a black image. The problem is cured by removing "-limit map 4096", or setting it to at least 2MB.

It looks like a bug to me.
snibgo's IM pages: im.snibgo.com
gaurnitai74
Posts: 13
Joined: 2013-04-04T03:30:30-07:00
Authentication code: 6789

Re: Black image output when memory limit is set

Post by gaurnitai74 »

Hi,
Can you please let us know if this is scoped to be fixed in the near future?
Thanks in advance,
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Black image output when memory limit is set

Post by dlemstra »

I was unable to track down why it happened this weekend. Since I have to combine IM with a full time job I won't be able to tell you when this will be fixed.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
gaurnitai74
Posts: 13
Joined: 2013-04-04T03:30:30-07:00
Authentication code: 6789

Re: Black image output when memory limit is set

Post by gaurnitai74 »

Hi Dlemstra,
Thank you for your response. I tried ImageMagick 6.9.0-7 and it works without issues. We will freeze on this version for an upcoming project. Appreciate all your help.
Best Regards,
Post Reply