Looking for a software recomendation for FC3

Alexander Dalloz ad+lists at uni-x.org
Mon Mar 21 15:05:32 UTC 2005


Am Mo, den 21.03.2005 schrieb Tim Holmes um 14:47:

> I am looking for some software for my FC3 laptop.  I need a program that
> will download digital pictures from my Flashcard, and while it is doing
> so, change their names to whatever I specify.  The ideal would be some
> sort of image handling program, but I can live with something else if it
> will do the job.  I have installed wine, and gotten it running, but the
> Nikon Transfer program that I normally use will not run under wine
> (yet), and I need something else

> Tim Holmes

How about a bit of bash scripting and using GNU tools?

$ cat picturerename.sh

#!/bin/bash
 
# first parameter: flash card location
# second parameter: picture file names beginning to be exchanged with
following 3rd parameter
# third parameter: new picture name beginning
 
if [ $# -ne 3 ]; then
    echo "stopped - usage: picture.sh <path> <picture name beginning>
<new picture name beginning>"
    echo "example: ./picturerename.sh /mnt/flash dsc spring05"
exit 1
fi
 
counter=0
 
for file in $(find $1 -name "$2*" -print0 | xargs -0); do
    echo "processing ${file}: "
    cp -v ${file} $(echo $(basename ${file}) | sed -e
s/$2.*\[.*\]/$3${counter}./)
    let "counter = ${counter} + 1"
done

Script in action:

[adalloz at silentbob tmp]$ ls pictures/
dsc00001.jpg  dsc00002.jpg  dsc00003.jpg  dsc00004.jpg  dsc00005.jpg
[adalloz at silentbob tmp]$ ./picturerename.sh ./pictures/ dsc spring05_
processing ./pictures/dsc00001.jpg:
„./pictures/dsc00001.jpg“ -> „spring05_0.jpg“
processing ./pictures/dsc00003.jpg:
„./pictures/dsc00003.jpg“ -> „spring05_1.jpg“
processing ./pictures/dsc00004.jpg:
„./pictures/dsc00004.jpg“ -> „spring05_2.jpg“
processing ./pictures/dsc00005.jpg:
„./pictures/dsc00005.jpg“ -> „spring05_3.jpg“
processing ./pictures/dsc00002.jpg:
„./pictures/dsc00002.jpg“ -> „spring05_4.jpg“
[adalloz at silentbob tmp]$ ls
picturerename.sh  pictures  spring05_0.jpg  spring05_1.jpg 
spring05_2.jpg  spring05_3.jpg  spring05_4.jpg

Take it as an example and adjust it for your needs.

Alexander


-- 
Alexander Dalloz | Enger, Germany | GPG http://pgp.mit.edu 0xB366A773
legal statement: http://www.uni-x.org/legal.html
Fedora Core 2 GNU/Linux on Athlon with kernel 2.6.10-1.770_FC2smp 
Serendipity 15:59:55 up 4 days, 13:56, load average: 0.22, 0.38, 0.40 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20050321/4c470ff2/attachment-0001.sig>


More information about the fedora-list mailing list