rmagick-temp / rmagick

An interface to the ImageMagick and GraphicsMagick image processing libraries.
http://rmagick.rubyforge.org/
MIT License
790 stars 102 forks source link

Issue with LevelImageColors #94

Closed timfjord closed 10 years ago

timfjord commented 10 years ago

For some reason when i call level_colors method i get this error "RuntimeError: LevelImageColors failed for unknown reason."

[1] pry(main)> require 'RMagick'
=> true
[2] pry(main)> img = Magick::Image.read("/tmp/black.png").first
=> /tmp/black.png PNG 100x100 100x100+0+0 DirectClass 8-bit 5kb
[3] pry(main)> img.level_colors 'green', 'red', true
2013-12-12T09:59:05+02:00 0:20.980 0.030u 6.8.7 Configure ruby[29642]: configure.c/GetConfigureOptions/589/Configure
  Searching for configure file: "/usr/local/Cellar/imagemagick/6.8.7-0/share/ImageMagick-6/colors.xml"
2013-12-12T09:59:05+02:00 0:20.980 0.030u 6.8.7 Configure ruby[29642]: configure.c/GetConfigureOptions/589/Configure
  Searching for configure file: "/usr/local/Cellar/imagemagick/6.8.7-0/lib/ImageMagick//config-Q16/colors.xml"
2013-12-12T09:59:05+02:00 0:20.980 0.030u 6.8.7 Configure ruby[29642]: configure.c/GetConfigureOptions/589/Configure
  Searching for configure file: "/usr/local/Cellar/imagemagick/6.8.7-0/etc/ImageMagick-6/colors.xml"
2013-12-12T09:59:05+02:00 0:20.980 0.030u 6.8.7 Configure ruby[29642]: configure.c/GetConfigureOptions/589/Configure
  Searching for configure file: "/usr/local/Cellar/imagemagick/6.8.7-0/share/doc/ImageMagick-6/colors.xml"
2013-12-12T09:59:05+02:00 0:20.980 0.030u 6.8.7 Configure ruby[29642]: configure.c/GetConfigureOptions/589/Configure
  Searching for configure file: "/Users/timsly/.magick/colors.xml"
2013-12-12T09:59:05+02:00 0:20.980 0.030u 6.8.7 Configure ruby[29642]: color.c/LoadColorList/2078/Configure
  Loading color file "/usr/local/Cellar/imagemagick/6.8.7-0/etc/ImageMagick-6/colors.xml" ...
2013-12-12T09:59:05+02:00 0:20.980 0.030u 6.8.7 Resource ruby[29642]: resource.c/AcquireMagickResource/278/Resource
  Area: 80KB/80KB/4.295GB
2013-12-12T09:59:05+02:00 0:20.980 0.030u 6.8.7 Resource ruby[29642]: resource.c/AcquireMagickResource/278/Resource
  Memory: 80KB/156KiB/2GiB
2013-12-12T09:59:05+02:00 0:20.980 0.030u 6.8.7 Cache ruby[29642]: cache.c/OpenPixelCache/3571/Cache
  open /tmp/black.png[0] (Heap Memory, 100x100 78.1KiB)
RuntimeError: LevelImageColors failed for unknown reason.
from (pry):4:in `level_colors'
~  convert --version
Version: ImageMagick 6.8.7-0 2013-10-28 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC
Delegates: bzlib freetype jng jpeg ltdl png png xml zlib

On linux machine everything works fine

timfjord commented 10 years ago

After rollback gem version to 2.13.1 and imagemagick to 6.6.7-0 everything works fine.

mtyaka commented 10 years ago

This issue is caused by a bug in ImageMagick. It looks like it will get fixed in 6.8.8-2: http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=24751

mtyaka commented 10 years ago

I can confirm the problem was fixed in ImageMagick 6.8.8-2.

timfjord commented 10 years ago

Checked with ImageMagick 6.8.8-9 and rmagick-2.13.2. Everything works fine