gpt4 book ai didi

ruby-on-rails - JPEG 不被识别、回形针、ImageMagick on Rails 3.1.3 OSX Mountain Lion 识别

转载 作者:行者123 更新时间:2023-12-04 05:30:01 24 4
gpt4 key购买 nike

我已经浏览了所有关于此的 SO 问题,但没有任何乐趣。

升级到 Mountain Lion 后出现以下错误:

Validation failed: Photo /var/folders/92/qp3ppxv92tsglvj03ndp0t6m0000gn/T/stream20121007-36927-1dzwbgk-0.jpeg is not recognized by the 'identify' command.

并在日志中
Command :: identify -format %wx%h :file
[paperclip] An error was received while processing: # <Paperclip::NotIdentifiedByImageMagickError: /var/folders/92/qp3ppxv92tsglvj03ndp0t6m0000gn/T/stream20121007-36927-1dzwbgk-0.jpeg is not recognized by the 'identify' command.>

我正在使用:Ruby 1.8.7、Rails 3.1.3、OSX Mountain Lion、Homebrew 来安装依赖项

我已经添加
#development.rb
Paperclip.options[:command_path] = "/usr/local/bin"

我已经完全删除并重新安装了 Homebrew 软件
#brew doctor
Your system is raring to brew.

#brew list

ack gettext imagemagick libffi libpng little-cms pkg-config readline
cmake git jasper liblqr libtiff mysql postgresql xz
freetype glib jpeg libmagic libyaml ossp-uuid qt

我在另一个 SO 案例的推荐下安装了 liblqr,这带来了很多依赖项。

识别似乎从命令行工作
#identify /var/folders/92/qp3ppxv92tsglvj03ndp0t6m0000gn/T/stream20121007-36927-1dzwbgk-0.jpeg
/var/folders/92/qp3ppxv92tsglvj03ndp0t6m0000gn/T/stream20121007-36927-1dzwbgk-0.jpeg JPEG 259x195 259x195+0+0 8-bit DirectClass 11KB 0.000u 0:00.000

#identify -format %wx%h /var/folders/92/qp3ppxv92tsglvj03ndp0t6m0000gn/T/stream20121007-36927-1dzwbgk-0.jpeg
259x195

识别似乎从控制台工作

Loading development environment (Rails 3.1.3)
1.8.7 :001 > system("identify -format %wx%h /var/folders/92/qp3ppxv92tsglvj03ndp0t6m0000gn/T/stream20121007-36927-1dzwbgk-0.jpeg")
259x195
=> true

我已经安装了 rmagick - 尽管我以前从未使用过它。 gem :
*** LOCAL GEMS *** 
paperclip (2.7.1)
rmagick (2.13.1)

我已经尝试了所有建议的方法,现在完全没有想法了。关于如何深入挖掘以隔离问题的任何建议?原因是调整由 Paperclip 引起的 jpeg 或 PNG 文件的大小(我没有尝试过任何其他文件),因此:

has_attached_file :photo,
:styles => {:thumb => "100x100", :medium => "x140", :mediumplus => "x210",:large => "960x378" },
:storage => :s3,
:s3_credentials => {
:access_key_id => ENV['S3_KEY'],
:secret_access_key => ENV['S3_SECRET']
},
:s3_protocol => "https",
:bucket => ENV['S3_BUCKET'],
:path => ":attachment/:id/:style.:extension"

最佳答案

使用回形针 2.8.0 而不是 2.7.1。

关于ruby-on-rails - JPEG 不被识别、回形针、ImageMagick on Rails 3.1.3 OSX Mountain Lion 识别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12768219/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com