[Klug-general] GIMP Scripting

Julia Freeman klug at quixotic.org.uk
Thu Jun 23 12:47:15 UTC 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, Jun 23, 2011 at 01:01:17PM +0100, Paul Littlefield wrote:
>> http://photobatch.stani.be/
>
> Nice app, and thanks to Julia as well for those IM commands.
>
> Here is what I have so far:-
>
> $ cat ~/Bin/rotate_and_resize.sh
>
> #!/bin/bash
> FILENAME=$( echo "$1" | sed 's/\..\{3\}$//' )
> convert -rotate -90 "$1" "${FILENAME}_rotated.jpg"
> convert -resize 1024x768 "${FILENAME}_rotated.jpg" "${FILENAME}_resized.jpg"
>

you can also use "basename" to trim the name off.                               
                                                                                
$ basename filename.jpg .jpg                                                    
                                                                                
should return:                                                                  
                                                                                
filename                                                                        
                                                                                
Saves the regex abuse...                                                        
                                                                                
J 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFOAzKtpQ4p2TvRQNARAn2iAKCzhDfQfDNGesyOaQnrEZCd0IyUcACfV5K5
NraPOOrS2ItwXTq9Ngv9i+k=
=76fX
-----END PGP SIGNATURE-----



More information about the Kent mailing list