Jpg2xpm.sh
Aus VDR Wiki
(Unterschied zwischen Versionen)
(10 dazwischenliegende Versionen von 4 Benutzern werden nicht angezeigt) | |||
Zeile 1: | Zeile 1: | ||
− | = | + | '''Quelle:''' http://www.vdrportal.de/board/thread.php?threadid=14385 |
+ | |||
+ | '''Beschreibung:''' Skripts zum Konvertieren von Bildern ("jpg") nach ("xpm"). | ||
+ | |||
+ | {{Box Datei | jpg2xpm.sh | | ||
<pre> | <pre> | ||
#!/bin/sh | #!/bin/sh | ||
# | # | ||
− | # | + | # jpg2xpm.sh |
# | # | ||
# Source: http://www.vdrportal.de/board/thread.php?threadid=14385 | # Source: http://www.vdrportal.de/board/thread.php?threadid=14385 | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | LOGO_WIDTH=64 | |
+ | LOGO_HEIGHT=48 | ||
+ | LOGO_DEPTH=16 | ||
− | + | for INPUT in `find -maxdepth 1 -name "*.jpg"`; | |
− | + | do | |
− | + | echo -n "Processing $INPUT: " | |
− | + | ||
− | + | ||
OUTPUT=`echo $INPUT | sed 's/^\(.*\)\(\.[^.]*\)$/\1/'` | OUTPUT=`echo $INPUT | sed 's/^\(.*\)\(\.[^.]*\)$/\1/'` | ||
OUTPUT="$OUTPUT.xpm" | OUTPUT="$OUTPUT.xpm" | ||
− | + | BATCHCMD="gimp -i -d -b '(script_fu_tovdr $LOGO_WIDTH $LOGO_HEIGHT $LOGO_DEPTH \"$INPUT\" \"$OUTPUT\")' '(gimp-quit 0)'" | |
− | + | eval $BATCHCMD | |
− | + | done | |
− | + | ||
− | + | ||
− | done | + | |
− | + | ||
</pre> | </pre> | ||
+ | }} | ||
− | + | {{Box Datei | ~/.gimp-<VERSION>/scripts/jpg2logo.scm | | |
<pre> | <pre> | ||
(define (script_fu_tovdr width height depth infile outfile) | (define (script_fu_tovdr width height depth infile outfile) | ||
Zeile 57: | Zeile 49: | ||
SF-FILENAME "Outfile" "/tmp/outfile.xpm") | SF-FILENAME "Outfile" "/tmp/outfile.xpm") | ||
</pre> | </pre> | ||
+ | }} | ||
+ | |||
+ | |||
+ | ===Alternative=== | ||
+ | Wenns nicht so fancy sein muss: | ||
+ | convert -colors 14 -resize 80x80 DATEI.jpg DATEI.xpm | ||
+ | |||
+ | Logos gibts zB auf | ||
+ | |||
+ | http://www.lyngsat-logo.com/tv/a.html | ||
+ | http://iconharmony.com/icons/watchtv?category=harmony1100 | ||
+ | http://www.harmony-remote-forum.de/viewtopic.php?t=6 | ||
+ | http://www.speedbomb.de/hobby/myhtpc/index.php?view=logostv64 | ||
+ | http://iconharmony.com/icons/watchtv?category=harmony1100 | ||
+ | |||
+ | |||
+ | |||
− | [[Kategorie: | + | [[Kategorie:Skripte]] |
Aktuelle Version vom 22. August 2009, 13:44 Uhr
Quelle: http://www.vdrportal.de/board/thread.php?threadid=14385
Beschreibung: Skripts zum Konvertieren von Bildern ("jpg") nach ("xpm").
#!/bin/sh # # jpg2xpm.sh # # Source: http://www.vdrportal.de/board/thread.php?threadid=14385 LOGO_WIDTH=64 LOGO_HEIGHT=48 LOGO_DEPTH=16 for INPUT in `find -maxdepth 1 -name "*.jpg"`; do echo -n "Processing $INPUT: " OUTPUT=`echo $INPUT | sed 's/^\(.*\)\(\.[^.]*\)$/\1/'` OUTPUT="$OUTPUT.xpm" BATCHCMD="gimp -i -d -b '(script_fu_tovdr $LOGO_WIDTH $LOGO_HEIGHT $LOGO_DEPTH \"$INPUT\" \"$OUTPUT\")' '(gimp-quit 0)'" eval $BATCHCMD done
(define (script_fu_tovdr width height depth infile outfile) (let* ((img (car (file-jpeg-load 1 infile infile))) (drawable (car (gimp-image-active-drawable img)))) (gimp-image-scale img width height) (gimp-convert-indexed img 2 0 depth 0 0 "") (file-xpm-save 1 img drawable outfile outfile 255))) (script-fu-register "script_fu_tovdr" _"<Toolbox>/Xtns/Script-Fu/Utils/TOVDR" "TOVDR" "niklot" "niklot" "2003-03-25" "" SF-VALUE "Width" "64" SF-VALUE "Height" "48" SF-VALUE "Depth" "16" SF-FILENAME "Infile" "/tmp/infile.jpg" SF-FILENAME "Outfile" "/tmp/outfile.xpm")
[Bearbeiten] Alternative
Wenns nicht so fancy sein muss: convert -colors 14 -resize 80x80 DATEI.jpg DATEI.xpm
Logos gibts zB auf
http://www.lyngsat-logo.com/tv/a.html http://iconharmony.com/icons/watchtv?category=harmony1100 http://www.harmony-remote-forum.de/viewtopic.php?t=6 http://www.speedbomb.de/hobby/myhtpc/index.php?view=logostv64 http://iconharmony.com/icons/watchtv?category=harmony1100