Batterhead
unread,Oct 18, 2011, 10:01:59 PM10/18/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to carrierwave
hi,
my rails app on Windows 7 cannot successfully resize and upload images
with the following error returned by carrierwave.
Failed to manipulate with MiniMagick, maybe it is not an image?
Original Error: identify -ping C:/Users/User/xxxxxxxxx.jpg
here is my uploader:
[avataruploader.rb]
class AvatarUploader < CarrierWave::Uploader::Base
include CarrierWave::MiniMagick
process :resize_to_fill => [200, 200]
end
i checked mini_magick.rb and found the error message comes from
manipulate!. every time when the first command is executed, the same
exception thrown.
image = ::MiniMagick::Image.from_file(current_path)
i guess the problem should be coming from current_path which passed in
by carrierwave to minimagick. the comment lines in the source say
'This method assumes that the object responds to +current_path+.'.
[mini_magick.rb]
def manipulate!
image = ::MiniMagick::Image.from_file(current_path)
image = yield(image)
image.write(current_path)
::MiniMagick::Image.from_file(current_path)
rescue ::MiniMagick::Error => e
raise CarrierWave::ProcessingError.new("Failed to manipulate
with MiniMagick, maybe it is not an image? Original Error: #{e}")
end
if my memory serves correctly, current_path is holding 'C:/Users/User/
xxxxxxxxx.jpg'. i have no idea about how current_path is used to store
a value and i never defined any path in my app pointing to C:/Users/
User/ folder.
i have the path on my machine but the xxxxxxxxx.jpg was never created.
now i have the following questions:
1. what is C:/Users/User/xxxxxxxxx.jpg for? is it a cache file?
2. am i missing something in my configuration leading to the failure
of the jpg creation?
3. i don't mind the jpg is created in C:/Users/User/ folder, but where
is it defined? i never did it.
4. am i having the correct versions of the following components
installed? any compatibility issue here?
gemfile
"activerecord", "2.3.14"
"carrierwave", "0.4.10"
"mini_magick", "3.2.1"
"rails", "2.3.14"
Platform
windows 7 64bit
ruby 1.8.7
imagemagick (installation path = C:\ImageMagick-6.7.2-Q16)
4. any advice on how to fix the problem?
many questions here and i have been trying to fix this problem for few
days.
i'm trying to describe everything that i know, please help.
batterhead