Page 1 of 1

IM 6.7.7 problem + scripting problem

Posted: 2012-05-24T02:25:30-07:00
by VanGog
I am now testing IM 6.7.7 + CygWin.

I have copied the codes from /developers/slice discussion and save them under
test(number).sh

here are screenshots of errors:

note the strange imagemagick_.dll error

http://i50.tinypic.com/2nkj5ht.jpg
http://i47.tinypic.com/166bv45.jpg

Yet translation of errors:
"příkaz nenalezen" .... command not found
the last error is syntax error, incorrect arithmetical operator, incorrect token

Re: IM 6.7.7 problem + scripting problem

Posted: 2012-05-24T03:04:46-07:00
by VanGog

Code: Select all

#!/bin/sh 

convert $infile \
       -crop ${xspace}x0 +repage -background $vcolor -splice ${thickness}x0 +append \
       -crop 0x${yspace} +repage -background $hcolor -splice 0x${thickness} -append \
       ${inname}_grid_expand.jpg



convert rose: -crop 10x10 \
        -set page '+%[fx:page.x+3*page.x/10]+%[fx:page.y+3*page.y/10]' \
         -background skyblue -layers merge +repage  grid_tile_fx.png
http://i50.tinypic.com/29fktl.jpg

I change $infile for rose:, but the problem stays unchanged

Re: IM 6.7.7 problem + scripting problem

Posted: 2012-05-24T11:05:16-07:00
by fmw42
Does the rose: example not work? What is the error message in English. I cannot read the language you have in your error image.

What version of IM?

Is Cygwin working correctly? Test with a simple command to convert an image with some simple operation such as -flip.

You do not need Cygwin to do the first example processing. It converts easily to windows. Just put in the exact values you need and change the \ to ^ and put in the exact input and output you want.

See http://www.imagemagick.org/Usage/windows/. There are batch file scripting notes there if you want a bat file.

Re: IM 6.7.7 problem + scripting problem

Posted: 2012-05-24T11:53:02-07:00
by VanGog
VanGog wrote:I am now testing IM 6.7.7 + CygWin.

note the strange imagemagick_.dll error

http://i50.tinypic.com/2nkj5ht.jpg
http://i47.tinypic.com/166bv45.jpg

Yet translation of errors:
"příkaz nenalezen" .... command not found
the last error is syntax error, incorrect arithmetical operator, incorrect token
Yes CYGWin Works well and IM is running, I made a test after instalation.

What is it correctly? See the error above in the black image - the error should to be in english and it is in yellow cycle

Re: IM 6.7.7 problem + scripting problem

Posted: 2012-05-24T15:37:07-07:00
by fmw42
I cannot read the language marked by the red bar. Nevertheless, if you are calling the script from, you may either need 1) to provide the full path to the script and/or provide the full path to convert. Your Cygwin may not be set up to have the path to convert in your PATH environment variable. That is the best I can suggest as a guess without further debugging information, especially as I am not a windows user.

Re: IM 6.7.7 problem + scripting problem

Posted: 2012-05-24T22:26:08-07:00
by anthony
It looks like invisible spaces are present after the line continuation escape '\'


Also in the script using ${....} these are shell variables that have to be defined. In my example I directly inserted numbers instead of shell variables.

Re: IM 6.7.7 problem + scripting problem

Posted: 2012-05-25T00:02:59-07:00
by VanGog
fmw42 wrote:I cannot read the language marked by the red bar. Nevertheless, if you are calling the script from, you may either need 1) to provide the full path to the script and/or provide the full path to convert. Your Cygwin may not be set up to have the path to convert in your PATH environment variable. That is the best I can suggest as a guess without further debugging information, especially as I am not a windows user.
Excuse me, what red bar? In the first image there is only yellow cycle, on the second there is red cycle around IM version.

My PATH directory to IM is set.

I will try to repair it later, when I will be on the computer with CYGWIN.

Re: IM 6.7.7 problem + scripting problem

Posted: 2012-05-25T10:13:29-07:00
by fmw42
Excuse me, what red bar?
In your terminal window image. But my mistake, the parts I could not read are your directory and user. So no big deal. I am not sure how to interpret the parts you say have command not found. Sorry. I do not know what further to do to help as I am not a windows user nor have I used or set up Cygwin.

Re: IM 6.7.7 problem + scripting problem

Posted: 2012-05-28T05:16:56-07:00
by VanGog
anthony wrote:It looks like invisible spaces are present after the line continuation escape '\'

Also in the script using ${....} these are shell variables that have to be defined. In my example I directly inserted numbers instead of shell variables.
Yes, there are carriage \r at end of line and I don't know how to get it out of there, but I think I will leave CygWin.

Re: IM 6.7.7 problem + scripting problem

Posted: 2012-05-28T20:08:27-07:00
by anthony
The 'carrage return' with a newline is what Windows likes to add to text files. But UNIX commands (that cgywin uses) do not like it.

You may need a better text editor or notepad, and turn of returns for end of line for cygwin scripts.

Alternative, remove them with
tr -d '\015' < old_file > new_file

Re: IM 6.7.7 problem + scripting problem

Posted: 2012-05-29T06:32:06-07:00
by VanGog
anthony wrote:tr -d '\015' < old_file > new_file
There is the problem with CygWin that I cannot paste a code into it. I'm simply to lazy to experiments with CygWin. I will wait new version of IM.

Re: IM 6.7.7 problem + scripting problem

Posted: 2012-05-29T09:28:17-07:00
by fmw42
Try pasting your code into a Windows text editor, fix the line endings and then copy and paste that into your Cygwin window.