Page 1 of 1

An error that I can't find ...

Posted: 2013-11-20T09:11:09-07:00
by naut
Hi there,

I need to make an edge of an image transparent and I've found the whole parameters that I have to give so that it works fine on my Windows machine.
When I move the whole command to the webserver (Unix) however, it doesn't work.

Code: Select all

/usr/local/bin/convert -alpha set -compose DstOut (-size 347x303 xc:none -draw 'polygon 0,0 0,55 55,0' -write mpr:triangle  +delete) (mpr:triangle) -gravity northwest -composite ../files/REX_MEDIA[1] ../files/cornerBigLeft/curoff3.png
This command here works fine on the server tho (conversion to png works fine, i also tried to crop and that worked aswell):

Code: Select all

/usr/local/bin/convert  ../files/REX_MEDIA[1] ../files/cornerBigLeft/curoff3.png
So I suspect the error is sitting somewhere in here:

Code: Select all

-alpha set -compose DstOut (-size 347x303 xc:none -draw 'polygon 0,0 0,55 55,0' -write mpr:triangle  +delete) (mpr:triangle) -gravity northwest -composite
Can someone give me a hint maybe? Or at least confirm to me that I'm crazy ... because that's how I'm starting to feel!

Cheers and thanks,
~naut

Re: An error that I can't find ...

Posted: 2013-11-20T09:25:52-07:00
by snibgo

Code: Select all

/usr/local/bin/convert 
  -alpha set -compose DstOut 
  (-size 347x303 xc:none -draw 'polygon 0,0 0,55 55,0' -write mpr:triangle  +delete) 
  (mpr:triangle) 
  -gravity northwest -composite 
  ../files/REX_MEDIA[1]
  ../files/cornerBigLeft/curoff3.png
I've broken your command into lines to make it easier to read.

Parentheses ( and ) need a space before and after each one.

You create an image of a triangle, save it into mpr:triangle, remove it from the stack then read it again. This is unnecessary work.

The "-composite" should do nothing because there is only one input image.

What is "../files/REX_MEDIA[1]"? Is this an image file that exists? If so, then you now have two input images. When you write the output "../files/cornerBigLeft/curoff3.png" it will create two output files.

Perhaps you intended to put "-composite" after reading "../files/REX_MEDIA[1]".

You may be using two different versions of ImageMagick. Operations should be put in their logical order, but some old versions allowed illogical orders.

Re: An error that I can't find ...

Posted: 2013-11-21T03:54:21-07:00
by naut
Thanks a lot for your help! :)

It's really that I have an old version on my system here and I forgot to escape the parentheses for the unix server. Now it's working fine!