2007-01-27 : Différence entre versions
De Asso Val Libre
(→Conversion par lot de format graphiques) |
|||
Ligne 19 : | Ligne 19 : | ||
#!/usr/bin/make -f | #!/usr/bin/make -f | ||
− | + | BMP=$(wildcard *.bmp) | |
− | all: $( | + | all: $(BMP:.bmp=.jpg) |
.SUFFIXES: .jpg .bmp | .SUFFIXES: .jpg .bmp | ||
− | .jpg | + | .bmp.jpg: |
convert $< $@ | convert $< $@ | ||
Version du 27 janvier 2007 à 21:59
À voir
- Machine Aquario
- Site aquario / album photo / diaporama
Conversion par lot de format graphiques
Depuis le temps que j'y pensais, voici un exemple de script commenté :
L'exempe ci-dessous converti les fichiers .jpg en .bmp en utilisant convert. C'est un script pour l'utilitaire make
Mettre le texte suivant dans un fichier dénommé Makefile dans le répertoire de travail. Ensuite au même endroit, simplement taper la commande
make
#!/usr/bin/make -f BMP=$(wildcard *.bmp) all: $(BMP:.bmp=.jpg) .SUFFIXES: .jpg .bmp .bmp.jpg: convert $< $@
Attention, devant la commande convert l'espace vide est une tabulation (impératif)