Bugs: Browse | Submit New | Admin

[#14495] Quoted dimension values are quoted again and result in error

Date:
2007-10-06 02:19
Priority:
3
Submitted By:
Aaron Chandler (modulaar)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
Quoted dimension values are quoted again and result in error

Detailed description
-version 1.2.3-

Passing quoted dimension values results in a MiniMagickError due to double-quoting:

******
>> path = "#{RAILS_ROOT}/public/images/ad_120x90.png"
>> image = MiniMagick::Image.new("#{path}")
>> w, h = image['%w %h'].split
identify: unable to open image `%h': No such file or directory.
MiniMagick::MiniMagickError: ImageMagick command (identify -format ""%w %h""
"/Users/aaron/mysite/public/images/ad_120x90.png") failed: Error Given 256
        from /Users/aaron/mysite/vendor/plugins/mini_magick-1.2.3/lib/mini_magick.rb:124:in `run_command'
        from /Users/aaron/mysite/vendor/plugins/mini_magick-1.2.3/lib/mini_magick.rb:66:in `[]'
        from (irb):3
>>
*******

Changing mini_magick.rb line 117 from

arg = %|"#{arg}"| unless arg[0] == ?-

to

arg = %|"#{arg}"| unless arg[0] == ?- or arg.scan(/\"(.*)\"/).length > 0

solves the problem.

-Aaron

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item