lib/paperclip/geometry.rb in bteitelb-paperclip-2.3.1.10 vs lib/paperclip/geometry.rb in bteitelb-paperclip-2.3.1.11

- old
+ new

@@ -13,11 +13,16 @@ # Uses ImageMagick to determing the dimensions of a file, passed in as either a # File or path. def self.from_file file file = file.path if file.respond_to? "path" + if RUBY_PLATFORM =~ /mswin32/ + args = %Q[-format ^%wx^%h "#{file}"[0]] + else + args = %Q[-format "%wx%h" "#{file}"[0]] + end geometry = begin - Paperclip.run("identify", %Q[-format "%wx%h" "#{file}"[0]]) + Paperclip.run("identify", args) rescue PaperclipCommandLineError "" end parse(geometry) || raise(NotIdentifiedByImageMagickError.new("#{file} is not recognized by the 'identify' command."))