imagemagick-stream icon indicating copy to clipboard operation
imagemagick-stream copied to clipboard

Can't issue "+" options?

Open michael-ts opened this issue 6 years ago • 4 comments

I'm trying to do a crop, followed by a rotate, followed by another crop. However, for the last crop to work, I need a "+repage" right before it. I can't see any way to do this, as both "set" and "op" insert a "-" and nothing I can see inserts a "+" before the command.

Is there some other way I can get it to work?

michael-ts avatar May 28 '18 23:05 michael-ts

As a workaround, op("repage", "0x0+0+0") gets rid of the "Error: convert: geometry does not contain image" exception, but there may be other "+" options that don't have an equivalent "-"...

michael-ts avatar May 28 '18 23:05 michael-ts

That's interesting. I've never actually used the + operators myself. Would allowing something like .op('+repage', ...) be enough for your use case?

eivindfjeldstad avatar May 30 '18 12:05 eivindfjeldstad

@eivindfjeldstad I think so... Probably a simple change like this would work:

op (key, val) {
  this[operators].push(`${key[0]!='+'?'-':''}${key}`);

michael-ts avatar May 30 '18 13:05 michael-ts

I don't have a lot of spare time right now, but PR is welcome:)

eivindfjeldstad avatar May 31 '18 13:05 eivindfjeldstad