rmagick

Error installing Rmagick on Mountain Lion

Deadly 提交于 2020-02-10 21:29:26
问题 I have seen other people with the same issue of installing RMagick on Mountain Lion However none of the suggested solutions have allowed me to successfully install rmagick. Here is the error message I am getting: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. checking for Ruby version >= 1.8.5... yes checking for /usr/local/bin/gcc-4.2... yes checking for Magick-config... yes checking for ImageMagick version >= 6.4.9... yes checking for HDRI disabled version

Error installing Rmagick on Mountain Lion

╄→尐↘猪︶ㄣ 提交于 2020-02-10 21:29:05
问题 I have seen other people with the same issue of installing RMagick on Mountain Lion However none of the suggested solutions have allowed me to successfully install rmagick. Here is the error message I am getting: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. checking for Ruby version >= 1.8.5... yes checking for /usr/local/bin/gcc-4.2... yes checking for Magick-config... yes checking for ImageMagick version >= 6.4.9... yes checking for HDRI disabled version

Convert .pdf to images using RMagick & Ruby

老子叫甜甜 提交于 2020-01-22 05:21:07
问题 I'd like to take a pdf and convert it to images...each pdf page becoming a separate image. There's a similar post here: Convert a .doc or .pdf to an image and display a thumbnail in Ruby? But it doesn't cover how to make separate images for each page. 回答1: ImageMagick can do that with PDFs. Presumably RMagick can do it too, but I'm not familiar with it. EDIT: The code from the post you linked to: require 'RMagick' pdf = Magick::ImageList.new("doc.pdf") pdf is an ImageList object, which

no such file to load — RMagick2.so

强颜欢笑 提交于 2020-01-14 09:29:26
问题 I am really struggling to understand the meaning of the error below. I develop on OS X Lion, and I have RMagick installed there, and my code works flawlessly. Yet on the production RedHat machine, the below: MissingSourceFile (no such file to load -- RMagick2.so): rmagick (2.13.1) [v] lib/RMagick.rb:11 Yes, I installed the rmagick gem locally to both machines. And I have unpacked the gem on each machine to vendor/gems. What is probably the funniest to me is that this error is so stupid. There

RMagick mask Paperclip image attachment

假装没事ソ 提交于 2020-01-03 03:54:23
问题 I am using Paperclip to attach image files to an object and all is well but I'd also like to mask (preferably only one of the image style – main_feature) the image upon upload. I'm able to save my masked image using masked_image.write('result.png') but can't seem to get it to update the image attribute for Paperclip. With the following code I get this error: No handler found for /var/folders/q1/xf59whv514lgw_xr10hb208m0000gn/T/gaither-nomask20130312-80235-yaj1s7.png PNG 1020x470 1020x470+0+0

Low quality when converting PDF to JPG

左心房为你撑大大i 提交于 2020-01-02 07:37:42
问题 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

Combine Thumbnails to One Large Image with RMagick

纵然是瞬间 提交于 2020-01-01 03:04:05
问题 What's the shortest way to combine say 20 256x256 thumbnails into a single large image of 4 rows by 5 columns using RMagick? 回答1: Assuming all the images are in the current directory and named from 1.jpg to n.jpg and row * col = n. include Magick row = NUM_ROWS col = NUM_COLS ilg = ImageList.new 1.upto(col) {|x| il = ImageList.new 1.upto(row) {|y| il.push(Image.read((y + (x-1)*col).to_s + ".jpg").first)} ilg.push(il.append(false))} ilg.append(true).write("out.jpg") 来源: https://stackoverflow

Understanding ImageMagick's convert and translating to Ruby RMagick

别等时光非礼了梦想. 提交于 2019-12-30 10:03:33
问题 I'm failing at translating the following PHP/ImageMagick code into Ruby RMagick (to make it more manageable for future users and to understand what it's really doing): $output = array(); $returnValue = 0; $pngFiles = $myDir->find("/.png$/i"); foreach($pngFiles as $pngFile) { $cmd = 'convert '.$pngFile->path.' -resize 1x1 -alpha on -channel o -format "%[fx:u.a]" info:' exec($cmd, $output, $returnValue); if($output[0] != 1) { logMessage("PNG file contains some alpha transparency and will not be

ImageMagick Install Windows

亡梦爱人 提交于 2019-12-30 03:19:05
问题 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

Properly converting a CMYK image to RGB with RMagick

不想你离开。 提交于 2019-12-29 04:02:09
问题 I have been using the below to do a color conversion if @image.colorspace == Magick::CMYKColorspace # @image.colorspace #=> CMYKColorspace=12 @image.colorspace = Magick::RGBColorspace @image = @image.negate end It works, approximately, but the color luminosity is off. The fact that I need to negate the image leaves a very bad smell. The documentation mentions using color_profiles, but beyond that I can not find much. I am now trying @image = @image.quantize(16777216, Magick::RGBColorspace)