rmagick

Can't install rmagick gem on Ubuntu 13.04

拈花ヽ惹草 提交于 2019-12-03 04:16:45
When I try to install rmagic with: gem install rmagic it gives error: Building native extensions. This could take a while... ERROR: Error installing rmagick: ERROR: Failed to build gem native extension. /home/biske/.rbenv/versions/2.0.0-p247/bin/ruby extconf.rb checking for Ruby version >= 1.8.5... yes checking for gcc... yes checking for Magick-config... yes checking for ImageMagick version >= 6.4.9... yes checking for HDRI disabled version of ImageMagick... yes checking for stdint.h... yes checking for sys/types.h... yes checking for wand/MagickWand.h... no Can't install RMagick 2.13.2. Can

Carrierwave crop specific version

对着背影说爱祢 提交于 2019-12-03 03:59:03
问题 I am working on the ability to crop images using carrierwave and Jcrop. Its a combination of Railscasts episode 182 and 253. I have cropping working but it crops the original. Is there anyway to force manupulate! to use a different version? def crop_image(x,y,w,h) manipulate! do |img| img.crop(x.to_i, y.to_i, w.to_i, h.to_i) end end or is there a way to set the version from the model call? attr_accessor :crop_x, :crop_y, :crop_w, :crop_h attr_accessible :description, :image, :crop_x, :crop_y,

Problem installing RMagick rubygem on Centos 5

丶灬走出姿态 提交于 2019-12-02 18:18:26
I'm having problems installing the RMagick rubygem on Centos 5. I've followed the steps detailed in http://rmagick.rubyforge.org/install2-linux.html but when I try: sudo gem install rmagick the result is: Building native extensions. This could take a while... ERROR: Error installing rmagick: ERROR: Failed to build gem native extension. /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.11.0. Can't find Magick-config in /usr/bin:/bin *** extconf.rb failed *** Could not create Makefile due to

Carrierwave crop specific version

五迷三道 提交于 2019-12-02 18:17:18
I am working on the ability to crop images using carrierwave and Jcrop. Its a combination of Railscasts episode 182 and 253. I have cropping working but it crops the original. Is there anyway to force manupulate! to use a different version? def crop_image(x,y,w,h) manipulate! do |img| img.crop(x.to_i, y.to_i, w.to_i, h.to_i) end end or is there a way to set the version from the model call? attr_accessor :crop_x, :crop_y, :crop_w, :crop_h attr_accessible :description, :image, :crop_x, :crop_y, :crop_w, :crop_h after_update :reprocess_image, :if => :cropping? def cropping? !crop_x.blank? &&

RMagick + Rails + Heroku?

蹲街弑〆低调 提交于 2019-12-02 17:46:41
I'm trying to figure out how to get rmagick on my app, and then make it work on Heroku? For Rails3, you have to add this specification: gem "rmagick", "2.12.0", :require => 'RMagick' Note: require is CAsE SeNSITIvE Ok so for future reference heres what needs to be done. In your .gems file you need: rmagick and then in your config/environment.rb file you need: config.gem "rmagick", :lib => "RMagick" Because its already preinstalled with heroku - this does the trick. mattwallace Once I did the following from capps answer. gem "rmagick", "2.12.0", :require => 'RMagick' Then I added the require

Resize existing images to new style in paperclip & RMagick

馋奶兔 提交于 2019-12-02 15:39:33
I've been using paperclip to upload and auto-resize photos in my Rails app, and I love it. Only problem is about every other month my crazy manager decides he wants a new size to display the photos in. So I add a new style in my Photo model and all is good for new photos, but the pre-existing photos are now a problem. Now that I'm starting to have more than a few photos to deal with I need a programmatic way to resize existing photos. Perhaps there is some paperclip trick for such a thing? I'd really rather not have to figure out RMagick and write a script myself if I don't have to. You want

Carrierwave RMagick not removing transparency in convert to jpg

岁酱吖の 提交于 2019-12-02 13:55:39
问题 I'm trying to upload a PNG and save a bunch of thumbnails. The thumbnails should all be JPG and not have any transparency. Somehow the file is saved as jpg but it has transparency... Here's my Uploader: # encoding: utf-8 class WinePhotoUploader < CarrierWave::Uploader::Base # Include RMagick or MiniMagick support: include CarrierWave::RMagick # include CarrierWave::MiniMagick # Choose what kind of storage to use for this uploader: storage :file # storage :fog # Override the directory where

Carrierwave RMagick not removing transparency in convert to jpg

不想你离开。 提交于 2019-12-02 03:26:27
I'm trying to upload a PNG and save a bunch of thumbnails. The thumbnails should all be JPG and not have any transparency. Somehow the file is saved as jpg but it has transparency... Here's my Uploader: # encoding: utf-8 class WinePhotoUploader < CarrierWave::Uploader::Base # Include RMagick or MiniMagick support: include CarrierWave::RMagick # include CarrierWave::MiniMagick # Choose what kind of storage to use for this uploader: storage :file # storage :fog # Override the directory where uploaded files will be stored. # This is a sensible default for uploaders that are meant to be mounted:

RMagick: Convert CMYK EPS to RGB PNG maintaining transparent background

僤鯓⒐⒋嵵緔 提交于 2019-12-01 21:16:49
问题 I've spent a long time trying to go from a CMYK EPS to a RGB PNG using RMagick and Rails. Hopefully this will be of use to someone: def convert_image_from_cmyk_to_rgb( image ) #puts image.alpha? if image.colorspace == Magick::CMYKColorspace image.strip! image.add_profile("#{Rails.root}/lib/USWebCoatedSWOP.icc") image.colorspace == Magick::SRGBColorspace image.add_profile("#{Rails.root}/lib/sRGB.icc") end image end You can download the ICC files direct from Adobe at http://www.adobe.com

CarrierWave and correct file extension depending on its contents

孤街醉人 提交于 2019-12-01 20:10:01
问题 How can I make CarrierWave add correct extension to filename depending on its contents? For example, if I upload file "logo" (PNG file without extension) CarrierWave should save it as "logo.png". And file "img.gif" (JPG file with incorrect extension) respectively should be saved as "img.jpg". 回答1: There's a couple of things you can do, depending on if you're using process or version to do this. If it's a version, the carrierwave wiki has a way to do conditional versions. https://github.com