Search code examples
ruby-on-rails-4carrierwaveminimagick

Picture Failed to manipulate with MiniMagick, maybe it is not an image? Original Error: `identify


been trying to upload photos with Carrierwave::MiniMagick, installed both gems but i get this error when trying to upload:

Picture Failed to manipulate with MiniMagick, maybe it is not an image? Original Error: identify C:/Users/JOHNO~1/AppData/Local/Temp/mini_magick20160918-2884-cgqjcw.png failed with error: identify: UnableToOpenConfigureFile magic.xml' @ warning/configure.c/GetConfigureOptions/709. identify: UnableToOpenConfigureFiledelegates.xml' @ warning/configure.c/GetConfigureOptions/709. identify: UnableToOpenModuleFile 'C:\ImageMagick-7.0.2-Q16\modules\coders\IM_MOD_RL_PNG_.dll': No such file or directory @ warning/module.c/GetMagickModulePath/680. identify: NoDecodeDelegateForThisImageFormat `PNG' @ error/constitute.c/ReadImage/508.

On page reload, the result page displays but the image doesn't.

This is my uploader:

class PictureUploader < CarrierWave::Uploader::Base

  include CarrierWave::MiniMagick

  storage :file

  def store_dir
    "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
  end

  version :thumb do
     process :resize_to_limit => [200, 200]
  end

  def extension_white_list
    %w(jpg jpeg gif png)
  end

end

This is my model:

class Article < ActiveRecord::Base
    mount_uploader :picture, PictureUploader
end

This is my migration file:

class CreateArticles < ActiveRecord::Migration
  def change
    create_table :articles do |t|
        t.string :title
        t.text :body
        t.string :picture
      t.timestamps null: false
    end
  end
end

Please any idea guys???....Thanks


Solution

  • Found the solution!!! I moved my ImageMagick installation folder to the same path as my sites folder. It now works flawlessly....yayy!