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

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
giecsar

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

Post 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?
Post Reply