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

Problems with Quantize #118

Open antoniodisanto92 opened 10 years ago

antoniodisanto92 commented 10 years ago

Hello,

I'm writing because I have a little Issue that I'm becoming crazy on trying to fix it, with no success atm.

I have a Rails app that generate some .tiff files in Grayscale and - in local [rmagick: 2.13.3 | ImageMagick: 6.8.9-8] - all is working fine. On my server, using dokku [rmagick: 2.13.3 - ImageMagick: 6.7.7-10], the .tiff files are correctly created as I want, but the quantize doesn't work. In this way, starting also from a Grayscale image, I get in output an RGB image.

Here is the part of the code in my Service:

schema = Magick::ImageList.new("public/img/test.png")
......
schema.format = 'tiff'
schema_path = "#{Rails.root}/tmp/NEW.tiff'
schema.quantize(256, Magick::GRAYColorspace).write(schema_path)
schema.destroy!
GC.start

return schema_path

Any idea? I have to force destroy and GC.start because the images can be heavy and big.

Thanks

bf4 commented 10 years ago

Please open an issue at https://github.com/gemhome/rmagick/ We no longer have commit to this repository

antoniodisanto92 commented 10 years ago

Done. Thanks