使用 MiniMagick::Image 获取不正确的图像标题创建图像

问题描述

我正在用 png 创建一个 MiniMagick::Image 图像,当我检查 valid? 函数时它给了我一个错误的结果: 有 2 个错误 composite: ImproperImageHeadercomposite: MissingAnImageFilename

这是我的代码

img = MiniMagick::Image.new(Tempfile.new(['label_creation_date','.png']).path)

MiniMagick::Image.new(Tempfile.new(['label_creation_date','.png']).path).tap do |tmp_image|
  MiniMagick::Tool::Convert.new.tap do |convert|
    convert << tmp_image.path
    convert.background 'transparent'
    convert.rotate '-4'
    convert << tmp_image.path.to_s
  end
end

我尝试了另一种解决方https://github.com/minimagick/minimagick/issues/59#issuecomment-3775000 在这里,但不幸的是它也不起作用。

请帮助我如何在 minimagick 的帮助下从头开始创建有效的图像?

谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)