An error that I can't find ...

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
naut
Posts: 2
Joined: 2013-11-20T09:01:27-07:00
Authentication code: 6789

An error that I can't find ...

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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.
snibgo's IM pages: im.snibgo.com
naut
Posts: 2
Joined: 2013-11-20T09:01:27-07:00
Authentication code: 6789

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

Post 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!
Post Reply