【发布时间】:2015-05-28 14:16:22
【问题描述】:
我在 Linux 服务器上使用 MiniMagick(ImageMagick 的 ruby 包装器)和 rails-4.2(ruby 2.2.0)。
我通过 ttf 生成图像。每个图像都有 1 到 10 层,然后我合并以创建图像。我收到一个错误,我找不到解决方案。
MiniMagick::Error (`convert -background none -fill #000000 -font ttf/SELIS006N.ttf -pointsize 300 label: S public/pictogram_images/873-layer-2.png` failed with error:
convert.im6: invalid geometry `+3.35542e+07+300.5' @ error/geometry.c/ParsePageGeometry/1407.
convert.im6: unable to clone cache `/tmp/magick-1r313oY0': No space left on device @ error/cache.c/CloneDiskToDiskPixelCache/852.
convert.im6: Image width exceeds user limit in IHDR `public/pictogram_images/873-layer-2.png' @ warning/png.c/MagickPNGWarningHandler/1754.
convert.im6: Invalid IHDR data `public/pictogram_images/873-layer-2.png' @ error/png.c/MagickPNGErrorHandler/1728.
):
SELIS006N.ttf是我的ttf文件,字符是“S”,图片路径是public/pictogram_images/873-layer-2.png
我用相同的 .ttf 字符测试字符,这是完全正常的,没有特殊性。
【问题讨论】:
-
3.35542e+07 = 33554200.0。没事吧?
-
是的,但是是生成的行,我只有“convert -background none -fill #000000 -font ttf/SELIS006N.ttf -pointsize 300 label: S public/pictogram_images/873-layer-2.png " 在我的代码中。
-
这是导致您的错误:“图像 width 超出用户限制”,所以,我认为这是错误的。检查为什么你传递了太长的宽度值。
-
我没有指定宽度,之前所有的图片都是一样的宽度,没有错误...
标签: ruby-on-rails ruby imagemagick imagemagick-convert minimagick