You are not logged in.

#1 2006-03-27 07:38:03

vladuz976
Member
From: Venice, CA
Registered: 2005-11-04
Posts: 108

bash shell script

hi,
can anybody here help me out with this?

#!/bin/bash
#shell script for resize

for i in $(find ./ -name "*.jpg");
do imlib2_convert "$i" -scale 80x60 "thumb-${i}"
done

I am running the script and it doesn't return any errors but it also doesn't create any thumbnails. what could be wrong?

Offline

#2 2006-03-27 08:34:50

MAC!EK
Member
Registered: 2005-09-27
Posts: 267

Re: bash shell script

for:

for ITEM in LIST; do                                               
    echo $ITEM                                                               
done                                                                            

The find expression wasn't working for all files:

for i in `find ~ -name *.jpg`; do
   echo $i
done

If it's working You can change the echo to imblib convert.

Offline

#3 2006-03-27 08:41:24

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: bash shell script

Well, two things:
- unless there's something wrong with my imlib2 install, the command is imlib2_conv, not imlib2_convert.
- imlib2_conv converts image formats e.g. png to jpg, and takes just two arguments, input file name and output file name.

If I'm on the wrong track, fell free to to let me know.

Offline

#4 2006-03-27 08:52:11

vladuz976
Member
From: Venice, CA
Registered: 2005-11-04
Posts: 108

Re: bash shell script

tomk wrote:

Well, two things:
- unless there's something wrong with my imlib2 install, the command is imlib2_conv, not imlib2_convert.
- imlib2_conv converts image formats e.g. png to jpg, and takes just two arguments, input file name and output file name.

If I'm on the wrong track, fell free to to let me know.

i think you're wrong.
imlib2_conv may convert from jpg to png and backwards. but "imlib2_convert" is basically a copy of imagemagick's "convert" which have -resize and -scale as flags respectively.
i am sure about the command coz it works on the command line, just not in the script.

Offline

#5 2006-03-27 09:04:43

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: bash shell script

OK - thanks. For my own curiosity, which package provides imlib2_convert? I have the 1.2.1-2 package installed, but I don't have that command.

Offline

#6 2006-03-27 18:23:47

vladuz976
Member
From: Venice, CA
Registered: 2005-11-04
Posts: 108

Re: bash shell script

tomk wrote:

OK - thanks. For my own curiosity, which package provides imlib2_convert? I have the 1.2.1-2 package installed, but I don't have that command.

i think there is an e17 package in one of the repos, but it's not up to date.
i have it installed from cvs with enlightenment 17 it's called imlib2_tools.

Offline

#7 2006-03-27 18:52:09

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: bash shell script

Thanks - that clears that up. smile

Offline

#8 2006-03-27 20:22:00

juergen
Developer
From: Frankfurt/Germany
Registered: 2005-04-11
Posts: 48
Website

Re: bash shell script

To avoid problems with whitespace your probably want:

find /path -iname "*.jpg" -execdir convert {} -scale 80x60 thumb-{} ;

Offline

Board footer

Powered by FluxBB