Failed to manipulate with MiniMagick, maybe it is not an image?

2,096 views
Skip to first unread message

Batterhead

unread,
Oct 18, 2011, 10:01:59 PM10/18/11
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

xldenis

unread,
Oct 19, 2011, 10:44:47 PM10/19/11
to carrierwave
I have the same problem on linux

timgremore

unread,
Oct 28, 2011, 9:01:09 AM10/28/11
to carrierwave
Same here - anyone able to shed some light on this?

Paul Chui

unread,
Nov 2, 2011, 7:40:47 AM11/2/11
to carrierwave
Seems Windows support by MiniMagick is very limited, I switched to RMagick and it is working fine.
batterhead
Reply all
Reply to author
Forward
0 new messages