rmagick

Why am I having a problem installing rmagick

心不动则不痛 提交于 2019-12-06 08:53:23
问题 On Ruby 1.8.7 and rails 2.3.5 I get: gem install rmagick ERROR: Error installing rmagick: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/rmagick-2.13.1 for inspection. Results logged to /Library/Ruby/Gems/1.8/gems/rmagick-2.13.1/ext

imagemagick leaves artifacts in gif to jpg list conversion

吃可爱长大的小学妹 提交于 2019-12-06 08:28:48
问题 ImageMagick splits the gif into jpgs but some of them have white pixels and others do not. convert -strip tree.gif tree.jpg Splits the gif into 86 jpgs. Here are #68 and #69. #68 and #69 and the gif in question: about 1/3 have a similar encoding issue. convert -version Version: ImageMagick 6.6.9-7 2012-08-17 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC Features: OpenMP uname -a Linux paul-Pangolin-Performance 3.2.0-23-generic #36-Ubuntu SMP Tue Apr

RVM + Ruby 1.9.2 + Rmagick + Lion = System Works, RVM Doesn't

☆樱花仙子☆ 提交于 2019-12-06 07:53:32
问题 I've installed Ruby 1.9.2 through RVM on a fresh install of OS X Lion. I have installed ghostscript and imagemagick through homebrew, and when running gem install rmagick using RVM, it fails. When using gem install rmagick on the system install of ruby, it works just fine. This is the error that is produced: ─wedtm@WedHQ ~/.rvm/gems/ruby-1.9.2-p290/cache ‹ruby-1.8.7› ╰─$ gem install rmagick 1 ↵ Building native extensions. This could take a while... ERROR: Error installing rmagick: ERROR:

RMagick: scale and resize image for thumbnail

隐身守侯 提交于 2019-12-06 07:14:09
I want to resize/scale an image. The originals have not the same dimensions like 300x200 or 512x600. I want to resize the image to 100x100 but DONT crop anything from the image or change ratio. Ideally the image will be first scale the long edge to 100 (aspect ratio) and then fill up the smaller edge with white. .---------. |- - - - -| | IMAGE | |- - - - -| '---------' I dont use Paperclip or Rails, just RMagick. I've done it with merging the resized image with a new 100x100 image. Thats for sure not the best way but it works: img = Magick::Image.read("file.png").first target = Magick::Image

Problems installing RMagick with Paperclip in Rails 3

◇◆丶佛笑我妖孽 提交于 2019-12-06 02:14:43
I'm trying to use paperclip in rails and when I'm doing the "bundle install" I'm getting the following error: Can't install RMagick 2.13.1. Can't find Magick-config in /usr/local/mysql/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin:/Users/seanhinton/.rvm/bin What I'm wondering is how do I install RMagick (is that what I need?) on my machine (it's OSX 10.6)? Cheers! RMagick is a ruby adapter for ImageMagick. Getting ImageMagick is a huge pain, and it doesn't come on your computer by default. Here's the easiest way to get it: Get

Low quality when converting PDF to JPG

ⅰ亾dé卋堺 提交于 2019-12-06 00:24:07
I'm attempting to use Imagemagic(RMAgick) to convert PDF-document into image. Original PDF is created from an image too(not native vector PDF). image = Magick::Image::from_blob(original_pdf) { self.format = 'PDF' } image[0].format = 'JPG' image[0].to_blob image[0].write(to_file.jpg) { self.quality = 100 self.density = 144 } But resulting image has too low quality, when printing. Original PDF has good quality in same time. I'm trying to use these options self.quality = 100 self.density = 144 or using PNG rather JPG, but all this doesn't work, only increase image size in kb ). Alex Avoyants

Ask RMagick to send a direct command to ImageMagick

大城市里の小女人 提交于 2019-12-05 22:03:45
Some options of ImageMagick are not supported by RMagick. Also sometimes it is in fact more convenient to use ImageMagick. Is there a method (of the Image object) that allows you to send commands directly to ImageMagick using the command line interface? Would it be ok for you to use system or system call via backticks (or similar)? You may also extend Magick::Image to do it easier. My example code add a method convert to call the convert-command of imagemagick for the actual image. The action to be performed must be added. require 'rmagick' module Magick class Image def convert( cmd ) `convert

RMagick transparency not working when compositing one image over another

☆樱花仙子☆ 提交于 2019-12-05 16:23:03
In the following code I'm trying to overlay a transparent square over the image of some mountains. I thought it would work, but by setting background_color = 'none' it doesn't make the image transparent! The result is a black square over the top left corner - desired result is the black square should be transparent. require 'open-uri' require 'RMagick' image_url = 'http://farm9.staticflickr.com/8446/7937080514_62d7749860.jpg' bg = Magick::ImageList.new open(image_url, 'rb') do |f| bg.from_blob(f.read) end layer = Magick::Image.new(200, 200) { self.background_color = 'none' } bg.each do |frame|

ImageMagick multiline text and background image

霸气de小男生 提交于 2019-12-05 16:04:58
I'm learning to use ImageMagick, but I'm having trouble when I try to generate an image like the example below: And for that, I'm using the following code: convert original.jpg -size 460x caption:'This is a multiline caption, This is a multiline caption, This is a multiline caption.' result.jpg This command generated two separate images, one with just the title. Can you help me? PS: I'm using RubyOnRails with ImageMagick, but you can suggest examples with MiniMagick or Rmagick. Thanks. This works in php and I can not see why it will not work o RubyOnRails: convert original.jpg -size 460x

Can't find wand/MagickWand.h

て烟熏妆下的殇ゞ 提交于 2019-12-05 15:54:24
问题 I have update my system to Ubuntu 15.04 and now Rmagick can't be installed... It gives me the following error: $ gem install rmagick -v '2.13.2' Building native extensions. This could take a while... ERROR: Error installing rmagick: ERROR: Failed to build gem native extension. /home/maria/.rvm/rubies/ruby-2.1.1/bin/ruby -r ./siteconf20150428-16155-3f5duq.rb extconf.rb checking for Ruby version >= 1.8.5... yes checking for gcc... yes checking for Magick-config... yes checking for ImageMagick