rmagick

CarrierWave + RMagick Square Crop?

…衆ロ難τιáo~ 提交于 2019-12-23 14:21:03
问题 I am trying to make a fixed square image crop with Ruby on Rails, CarrierWave, and RMagick. I have tried both of the following with no luck... version :thumb do process :resize_to_fit => [200, 200] end and version :thumb do process :resize_to_limit => [200, 200] end resize_to_limit obviously resizes the image to fit within the specified dimensions while retaining the original aspect ratio. So that's not right, but resize_to_fit doesn't do it either. I am looking at all of the available of the

CarrierWave + RMagick Square Crop?

坚强是说给别人听的谎言 提交于 2019-12-23 14:18:19
问题 I am trying to make a fixed square image crop with Ruby on Rails, CarrierWave, and RMagick. I have tried both of the following with no luck... version :thumb do process :resize_to_fit => [200, 200] end and version :thumb do process :resize_to_limit => [200, 200] end resize_to_limit obviously resizes the image to fit within the specified dimensions while retaining the original aspect ratio. So that's not right, but resize_to_fit doesn't do it either. I am looking at all of the available of the

Upgrade to Lion, failed to build gem native extensions

◇◆丶佛笑我妖孽 提交于 2019-12-23 12:13:37
问题 Not sure if my problem is related to this thread (http://stackoverflow.com/questions/6589066/rmagick-and-os-x-lion), but I just upgraded to Lion; more specifically I purchased an new machine and migrated over my old profile. I am unable to launch rails 3 because it cannot find rmagick, and I am unable to install rmagick, because I get the following error. I tried uninstalling rmagick and imageMagick, but I still get the same error when attempting to bundle install. Any thoughts? Thank you

RMagick returns nil reading JPEG

荒凉一梦 提交于 2019-12-23 04:43:07
问题 When I try to open a JPEG format file in Rails using RMagick, it always return nil with any jpg file. Other file formats open well. $ script/console Loading development environment (Rails 2.3.4) >> require 'RMagick' >> img = Image.read("1.gif").first => 1.gif GIF 230x100 230x100+0+0 PseudoClass 256c 8-bit 2kb >> img = Image.read("1.png").first => 1.png PNG 1280x800 1280x800+0+0 DirectClass 8-bit 156kb >> img = Image.read("1.jpg").first => nil Why this happens? 回答1: Do you have the jpeg

Ruby 1.9 compatible plotting / graphic library?

懵懂的女人 提交于 2019-12-23 02:47:14
问题 I feel like I have a simple desire that no one can satisfy: I want to be able to graph a set of points, and I am using Ruby 1.9.2. I would like to use Gruff or Scruffy, since these seem to be the easiest to use. However, they both rely on rmagick, and it seems that many other libraries do to. Rmagick isn't compatible with Ruby 1.9 though. (not to mention, I've read that you should just stay away from it anyways...I would enjoy hearing reasons) I am using wxRuby for a project, but in the

How to use ImageMagick to batch desaturate images?

旧时模样 提交于 2019-12-23 02:41:21
问题 I have an image that is black text with some gray and pale yellowish background. I basically want to keep the text as black as possible, and make the gray and yellow comparatively lighter...at the very least, turn yellow into a light gray. What's the most efficient way to do that in ImageMagick? 回答1: Answering the title question: you can batch desaturate images with the options -colorspace Gray OR -type Grayscale OR -modulate 100,0 - reference here: the options don't work identically Sample

RMagick transparency not working when compositing one image over another

北战南征 提交于 2019-12-22 09:17:56
问题 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

Can't find Magick-config [duplicate]

杀马特。学长 韩版系。学妹 提交于 2019-12-22 04:42:35
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: ImageMagick / RMagick - Can't install RMagick 2.13.1. Can't find Magick-config I am getting the following error when I try to run my dev console (MAC OS X / Snow Leopard). Does anyone know the solution? /usr/local/bin/ruby extconf.rb checking for Ruby version >= 1.8.5... yes checking for gcc... yes checking for Magick-config... no Can't install RMagick 2.13.1. Can't find Magick-config in .:/usr/local/bin:/usr

Can't find Magick-config [duplicate]

旧城冷巷雨未停 提交于 2019-12-22 04:42:11
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: ImageMagick / RMagick - Can't install RMagick 2.13.1. Can't find Magick-config I am getting the following error when I try to run my dev console (MAC OS X / Snow Leopard). Does anyone know the solution? /usr/local/bin/ruby extconf.rb checking for Ruby version >= 1.8.5... yes checking for gcc... yes checking for Magick-config... no Can't install RMagick 2.13.1. Can't find Magick-config in .:/usr/local/bin:/usr

Ruby graphic libraries

半城伤御伤魂 提交于 2019-12-21 20:37:33
问题 What's the difference between RMagic, ImageMagick, GD, etc. and which one should I use? I was looking for a thumbnail generation script and noticed that every script I found uses a different library for the same thing. 回答1: Imagemagick, GD, DevIL, and GraphicsMagick are libraries used to create and edit image files. RMagick is a ruby wrapper around ImageMagick/GraphicsMagick. You may find other wrappers I've had luck installing and configuring GraphicsMagick (similar to ImageMagick) and using