Problem with IM opening a temp file & failing to process it
Posted: 2010-09-07T15:18:22-07:00
Hello everyone,
I've installed IM on my PC along with MiniMagick to resize images in a Rails application. I am trying to create thumbnails for every image that the user uploads in its own gallery.
Here's the code:
The uploaded image is saved correctly, but I get an error from IM saying that the identify command failed to work on the image, but it says the image is located in a temp folder on my C: partition, why is that?
I've installed IM on my PC along with MiniMagick to resize images in a Rails application. I am trying to create thumbnails for every image that the user uploads in its own gallery.
Here's the code:
Code: Select all
# Saving the image file
File.open(path, "wb") { |f| f.write(upload['datafile'].read) } # write the file
# Creating the thumbnail
image = MiniMagick::Image.from_file(RAILS_ROOT+'/'+directory+name)
image.resize "100x100"
image.write(RAILS_ROOT+'/'+directory+"output.jpg")