【发布时间】:2014-05-30 06:36:56
【问题描述】:
我需要从回形针自定义处理器动态转换图像格式。
我的应用程序有 rails 3.2.18 和回形针 4.1
我正在尝试使用下面的“转换”命令转换格式。
extension = attachment.instance.resource_spec.extension
source = @file
destination = Tempfile.new([@basename, extension])
destination.binmode
Paperclip.run("convert #{File.expand_path(source.path)} {File.expand_path(destination.path)}")
扩展值将从数据库中获取。
Paperclip 无法通过处理器将图像转换为预期格式。
如果有请帮忙
提前致谢。
尼丁
【问题讨论】:
标签: ruby-on-rails ruby paperclip processor