使用RMagick将20个256x256缩略图组合成4行×5列的单个大图像的最短路径是什么?
可能重复:
ImageMagick/RMagick - 无法安装RMagick 2.13.1.找不到Magick-config
当我尝试运行我的开发控制台(MAC OS X/Snow Leopard)时,我收到以下错误.有谁知道解决方案?
/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/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Run Code Online (Sandbox Code Playgroud) 我只是想在windows下安装rmagick.
所以我用C/C++标头安装了ImageMagick,但似乎没有必要了.
然后我安装了Ruby Build Tools
ruby dk.rb init
ruby dk.rb install
Run Code Online (Sandbox Code Playgroud)
然后我想安装rmagick gem gem install rmagick.
但我得到这个错误:
H:\Downloads\ruby build tools>gem install rmagick
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
C:/Ruby192/bin/ruby.exe extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for stdint.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check …Run Code Online (Sandbox Code Playgroud) 我试图在RHEL上安装snorby.它要求红宝石,我试过,现在我卡住了rmagick错误.
请帮忙.
Installing rmagick (2.13.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
extconf.rb:128: Use RbConfig instead of obsolete and deprecated Config.
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
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable …Run Code Online (Sandbox Code Playgroud) 对于这个相当普通的问题很抱歉,但我想知道是否有人建议如何最好地允许用户裁剪和编辑自己的图像.
我想要发生的是,当用户在我的应用程序上传他们的图像以便应用程序显示图像的副本时,覆盖图只允许固定的宽高比(可能是4:3),那么用户就能够选择要裁剪的图像区域并保存为图像.
我能想到的最好的例子就是在Facebook上剪裁封面照片.
我已经研究了我认为需要的各种宝石和元素,如下所示:
Carrierwave - 对于文件上传(我觉得裁剪 - 纠正我,如果我错了)的ImageMagick /迷你Magick/Rmagick - 处理处理图像.
但是我仍然不确定这些是如何组合在一起的.
人们对宝石的最佳组合以及它们如何协同工作以获得这种裁剪功能的任何建议都将非常感激.
我正在尝试在Windows上安装ImageMagick.我做的是安装Windows RailsInstaller创建我的版本,现在我需要使用ImageMagick但由于某种原因它不起作用.
我拿了二进制源代码并从这个页面安装并运行它,但似乎没有做到这一点http://www.imagemagick.org/script/binary-releases.php#windows
我也尝试以下http://www.youtube.com/watch?v=gEWAVlNCKhg但它不起作用
对于第一个例子在cmd中,我所要做的就是以下命令让我理解为使它在我所能得到的工作
C:\Sites\case>convert wizard: wizard.jpg
Invalid Parameter - wizard.jpg
C:\Sites\case>convert wizard.jpg
Invalid drive specification.
C:\Sites\case>convert logo: logo.gif
Invalid Parameter - logo.gif
C:\Sites\case>$ convert logo: logo.gif
'$' is not recognized as an internal or external command,
operable program or batch file.
C:\Sites\case>
Run Code Online (Sandbox Code Playgroud)
然后我看到了这个.从https://github.com/rmagick/rmagick说它包括rmagick然后我运行bundle并得到这个
Installing rmagick (2.13.2)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
.
C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb
checking for Ruby version >= 1.8.5... yes
Invalid drive specification.
Unable to get ImageMagick version
*** …Run Code Online (Sandbox Code Playgroud) 来自Rmagick指南:
将图像转换为另一种格式
将图像转换为另一种格式就像将图像写入文件一样简单.
ImageMagick使用输出文件名suffix (".jpg"
for JPEG, ".gif" for GIF, for example)或prefix ("ps:" for
PostScript, for example)确定输出图像的格式.
有没有办法在内存中转换图像?
我正在尝试使用ruby中的Rmagick从文本创建图像文件.另外我需要它的背景透明.我的代码:
canvas = Image.new(400, 60)
watermark_text = Draw.new
watermark_text.annotate(canvas, 0,0,0,0, text) do
self.gravity = WestGravity
self.pointsize = 50
self.font = "whatever.ttf"
self.fill = 'black'
self.stroke = "none"
end
canvas.write(@path)
Run Code Online (Sandbox Code Playgroud)
它工作,但图像的背景是白色的,我需要它是透明的.有任何想法吗?文件保存为png.
当我尝试安装rmagic时:
gem install rmagic
Run Code Online (Sandbox Code Playgroud)
它给出了错误:
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't find MagickWand.h.
*** extconf.rb failed ***
Could …Run Code Online (Sandbox Code Playgroud) 我尝试将rails从4.1.1升级到4.2.0,然后我遇到错误安装Rmagick.在升级rails之前,Rmagick在rails4.1.1上运行良好.重新安装ImageMagick后我尝试了,但仍然出错.
这就是我得到的
sudo gem install rmagick -v 2.13.4
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for xcrun... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.4.9... yes
checking for stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... yes
checking for snprintf() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for AcquireImage() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... no
checking for AffinityImage() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... …Run Code Online (Sandbox Code Playgroud)