Page 1 of 1

Problem with IM opening a temp file & failing to process it

Posted: 2010-09-07T15:18:22-07:00
by giecsar
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:

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")
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?