Bugs: Browse | Submit New | Admin

[#14721] Assumes all mogrify parameters will be prefixed with a dash and not a plus sign

Date:
2007-10-15 08:00
Priority:
3
Submitted By:
(drummr77)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
Assumes all mogrify parameters will be prefixed with a dash and not a plus sign

Detailed description
Some mogrify parameters, such as 'polaroid' can be prefixed with a +.

For example, to generate a polaroid:

convert spiral_stairs_sm.jpg -thumbnail 120x120 \
          -bordercolor white -background black  +polaroid  poloroid.png

Mini-magick doesn't have a way to specify the + before polaroid.

Add A Comment: Notepad

Please login


Followup

Message
Date: 2007-12-10 14:34
Sender: Vanja Radovanović

I've solved the issue by adding a new method to the CommandBuilder
class:

  def add_command(symbol, *args)
    @args << "#{symbol}"
    @args += args
  end

Usage:
  image.combine_options do |command|
    command.background "black"
    command.add_command("+polaroid")
    command.format "png"
  end

Works just fine. I think the "def +(value)" is actually
for the same thing, but I couldn't get it to work...
Hope this helps...

P.S. the polaroid usage code is not entirely done, just
a ilustration...

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item