rmagick

RMagick error after installing OS X Mavericks

♀尐吖头ヾ 提交于 2019-11-30 23:52:14
I had RMagick installed and working perfectly in OS X Mountain Lion. I just installed OS X Mavericks and when I try to run rails s , I get this error: /.rvm/gems/ruby-2.0.0-p0@myapp/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `require': dlopen(/.rvm/gems/ruby-2.0.0-p0@myapp/gems/rmagick-2.13.2/lib/RMagick2.bundle, 9): Library not loaded: /usr/lib/libltdl.7.dylib (LoadError) Referenced from: /.rvm/gems/ruby-2.0.0-p0@myapp/gems/rmagick-2.13.2/lib/RMagick2.bundle Reason: image not found - /.rvm/gems/ruby-2.0.0-p0@myapp/gems/rmagick-2.13.2/lib/RMagick2.bundle from /.rvm

Create paperclip attachment from rmagick image

人走茶凉 提交于 2019-11-30 18:56:12
I have a problem to find a way to save an image created with RMagick in a paperclip attachment. imageList = Magick::ImageList.new imageList.new("images/apple.gif", "images/overlay.png") ... picture = imageList.flatten_images I am in a model that have an attached file has_attached_file :picture, :url => ..., :path => ... and i just want my image returned by imageList.flatten_images to be saved as the picture of my model. Does anyone know how to do it easily please? thanks jordinl Let's see if that's what you need picture = imageList.flatten_images file = Tempfile.new('my_picture.jpg') picture

RMagick error after installing OS X Mavericks

本秂侑毒 提交于 2019-11-30 17:20:38
问题 I had RMagick installed and working perfectly in OS X Mountain Lion. I just installed OS X Mavericks and when I try to run rails s , I get this error: /.rvm/gems/ruby-2.0.0-p0@myapp/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `require': dlopen(/.rvm/gems/ruby-2.0.0-p0@myapp/gems/rmagick-2.13.2/lib/RMagick2.bundle, 9): Library not loaded: /usr/lib/libltdl.7.dylib (LoadError) Referenced from: /.rvm/gems/ruby-2.0.0-p0@myapp/gems/rmagick-2.13.2/lib/RMagick2.bundle Reason:

Getting first image in gif using carrierwave

旧时模样 提交于 2019-11-30 14:15:35
Im using carrier wave to upload gifs which works just fine, the problem comes when i try to generate the thumb version and converting the gif into a jpeg with only the first image in the gif as the thumb, i get an error: LocalJumpError in ImagesController#create no block given (yield) app/controllers/images_controller.rb:21:in `new' app/controllers/images_controller.rb:21:in `create' Request Parameters: {"utf8"=>"✓", "authenticity_token"=>"lPEjP1WtPxFdizL2/FAWGHzOZPtecb5nKzKO8dg5ZdE=", "image"=>{"image"=>#<ActionDispatch::Http::UploadedFile:0x007ff5d4cdc720 @original_filename="some-file-name

Carrierwave - Resizing images to fixed width

≡放荡痞女 提交于 2019-11-30 12:57:48
问题 I'm using RMagick and want my images to be resized to a fixed width of 100px, and scale the height proportionally. For example, if a user were to upload a 300x900px, I would like it to be scaled to 100x300px. 回答1: Just put this in your uploader file: class ImageUploader < CarrierWave::Uploader::Base version :resized do # returns an image with a maximum width of 100px # while maintaining the aspect ratio # 10000 is used to tell CW that the height is free # and so that it will hit the 100 px

Can't install RMagick with rbenv

余生颓废 提交于 2019-11-30 12:45:05
I'm using rbenv on my Ubuntu 10.04 server and I already installed ImageMagick, but I can't get RMagick to install successfully. I get the following error message Can't install RMagick 2.13.1. Can't find MagickWand.h Any ideas? Thanks! You need to install the development headers for libmagickwand like so: apt-get install libmagickwand-dev 来源: https://stackoverflow.com/questions/9855818/cant-install-rmagick-with-rbenv

Carrierwave add a watermark to processed images

。_饼干妹妹 提交于 2019-11-30 12:32:26
问题 Im trying to add a watermark to processed images with below code I got from several resources: def watermark manipulate! do |img| logo = Magick::Image.read("#{Rails.root}/assets/images/watermarks/watermark.png").first img = img.composite(logo, Magick::SouthEastGravity, Magick::OverCompositeOp) end end Only problem is, you guess it, does not work. I get no errors in log/console whatsoever This is my method inside my uploaded and called like: def function version :thumb do process :resize_to

How do I take screenshots of web pages using ruby and a unix server? [closed]

眉间皱痕 提交于 2019-11-30 10:52:14
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I'm trying to programatically create thumbnail images of a large number of web pages that are hosted on my own ruby/rails-based website. I want to be able to code a stand-alone bit of ruby that looks something like this: require 'awesome-screenshot-maker' items.each do |id| url = "http://foo.com/bar/#{id}"

ImageMagick Install Windows

≯℡__Kan透↙ 提交于 2019-11-30 09:36:46
I am trying to install ImageMagick on Windows. What I did is install Windows RailsInstaller created my version and now I need to use ImageMagick but for some reason it doesn't work. I took the binary source code and install and run it from this page but didn't seem to do the trick http://www.imagemagick.org/script/binary-releases.php#windows I also try the following http://www.youtube.com/watch?v=gEWAVlNCKhg but it doesn't work For the first example In cmd all I have to do is the following command to my understand to make it work here what I get C:\Sites\case>convert wizard: wizard.jpg Invalid

RMagick - how do I find out the pixel dimension of an image

折月煮酒 提交于 2019-11-30 07:55:01
问题 This may be a stupid question, but how does one find the image width and height in pixels? image.x_resolution and image.y_resolution both return 0 for some reason. 回答1: require 'rmagick' img = Magick::Image.ping( 'demo.png' ).first width = img.columns height = img.rows Note .ping method imported from comments. If you need to read the image to process it, then use Magick::Image.read( 'demo.png' ).first - the use of ping works in this stand-alone code and speeds processing up for some image