using convert with find in script

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

Re: using convert with find in script

Post by anthony »

seems fine to me.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
zollsa
Posts: 9
Joined: 2013-03-15T09:18:09-07:00
Authentication code: 6789

Re: using convert with find in script

Post by zollsa »

Do you think it could be Ubuntu causing the error?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: using convert with find in script

Post by anthony »

More likely directory content and file permissions.

If you add "-r" to "xargs", then it will never execute the "xargs" command, if no files were found by "find".

As for why it is empty, does the directory exist and have ".jpg" or ".JPG" files?
also the parenthesis much be space separated from the other "find" arguments in find. that is \( and \) must have spaces on both sides to make it a separate argument to "find".
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
zollsa
Posts: 9
Joined: 2013-03-15T09:18:09-07:00
Authentication code: 6789

Re: using convert with find in script

Post by zollsa »

Sorry it took so long to respond. I got a lot of projects on my desk. I double checked the spacing and there was no space between the pipe and the \). I also checked the permissions. The directories are set to 755 and the scipt is 777. The directory that is holding the files just has 1 jpg and 1 png for testing purposes. I ran the script again with the echo and it's still blank.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: using convert with find in script

Post by anthony »

All I can suggest is to simply the find until you get it working, so as to discover where the problem is.

From what I can see it should be working.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply