IM 6.7.7 problem + scripting problem

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
VanGog
Posts: 308
Joined: 2012-02-05T02:46:58-07:00
Authentication code: 8675308

IM 6.7.7 problem + scripting problem

Post 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
VanGog
Posts: 308
Joined: 2012-02-05T02:46:58-07:00
Authentication code: 8675308

Re: IM 6.7.7 problem + scripting problem

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: IM 6.7.7 problem + scripting problem

Post 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.
VanGog
Posts: 308
Joined: 2012-02-05T02:46:58-07:00
Authentication code: 8675308

Re: IM 6.7.7 problem + scripting problem

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: IM 6.7.7 problem + scripting problem

Post 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.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: IM 6.7.7 problem + scripting problem

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
VanGog
Posts: 308
Joined: 2012-02-05T02:46:58-07:00
Authentication code: 8675308

Re: IM 6.7.7 problem + scripting problem

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: IM 6.7.7 problem + scripting problem

Post 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.
VanGog
Posts: 308
Joined: 2012-02-05T02:46:58-07:00
Authentication code: 8675308

Re: IM 6.7.7 problem + scripting problem

Post 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.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: IM 6.7.7 problem + scripting problem

Post 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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
VanGog
Posts: 308
Joined: 2012-02-05T02:46:58-07:00
Authentication code: 8675308

Re: IM 6.7.7 problem + scripting problem

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: IM 6.7.7 problem + scripting problem

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