• [^] # Merci

    Posté par . En réponse au message script + konqueror. Évalué à 1.

    Génial.
    C'est celà

    #!/bin/bash
    # Nom du nouveau répertoire
    NV_DOSSIER=reduc

    echo 'dossier'
    echo 1ドル
    cd "1ドル"

    # Création du nouveau dossier s'il n'existe pas
    if [ -d $NV_DOSSIER ] ;
    then
    echo "Le dossier reduc existe déjà"
    else
    mkdir $NV_DOSSIER
    fi
    rep=$(pwd)
    jourmois=$(date +'%d%m')
    rep="${rep##*/}"
    rep="${rep// /-}"

    # Pour toutes les photos (JPG) du répertoire
    for image in *[jJ][pP][gG] ;
    do
    width=$(identify -format '%w' "$image")
    height=$(identify -format '%h' "$image")
    ratio=$(echo "scale=2; $height / $width" |bc)
    echo $ratio

    if [ $ratio '<' .70 ]
    then
    image="${image##*/}"
    nv_nom=$(printf '%s_%s_%s\n' ${rep} ${jourmois} $image) #on dit merci à Fred

    # Réduit l'image en 601x400
    convert "$image" -resize 601x400 "$NV_DOSSIER/$nv_nom"
    # fusione l'image avec un calque contenant les coins
    composite -gravity center /home/sacha/Images/cadre.png "$NV_DOSSIER/$nv_nom" "$NV_DOSSIER/$nv_nom"
    # fin de la boucle FOR
    else
    nv_nom=$(printf 'thai_prod_%s_%s.jpg\n' ${rep} ${jourmois}) #on dit merci à Fred

    # Réduit l'image en 601x400
    convert "$image" -resize 200x150 "$NV_DOSSIER/$nv_nom"
    # fusione l'image avec un calque contenant les coins
    composite -gravity center /home/sacha/Images/cadremini.png "$NV_DOSSIER/$nv_nom" "$NV_DOSSIER/$nv_nom"
    fi
    done
    echo '-Fini !!!'
    exit




    Mille merci