#!/bin/sh if [ "`uname -o`" = "GNU/Linux" ] then html_reader="/usr/bin/firefox" else html_reader="/cygdrive/c/Users/NG002B82/Local\ Settings/Application\ Data/Mozilla\ Firefox/firefox.exe" fi mkdir exifstats_data # TODO : # - corrélation ouverture / focale # - vitesse d'obturation # Recherche de fichiers et récupérations des informations find . -iname '*.jpg' -exec exif '{}' \; | awk 'BEGIN{FS="|"}/^Focal Length /{n_foc[$2]++}END {for (k in n_foc) {printf("%.3g %s\n",k,n_foc[k])}}' | sort -n > exifstats_data/focale.dat find . -iname '*.jpg' -exec exif '{}' \; | awk 'BEGIN{FS="|"}/^F-Number/{n_foc[$2]++}END {for (k in n_foc) {printf("%.3g %s\n",substr(k,3,5),n_foc[k])}}' | sort -n > exifstats_data/aperture.dat find . -iname '*.jpg' -exec exif '{}' \; | awk 'BEGIN{FS="|"}/^ISO Speed Ratings/{n_foc[$2]++}END {for (k in n_foc) {printf("%d %d\n",k,n_foc[k])}}' | sort -n > exifstats_data/ISO.dat # Rédaction du script gnuplot # \EOF indique qu'il ne faut rien interpréter gnuplot <<\EOF reset set terminal svg font "Calibri" size 1000,400 unset key set style fill solid 1.0 # force le minimum de y à 0 set yrange [0:] # ===== FOCALE ===== set out 'exifstats_data/focale.svg' set xlabel 'Focale (mm)' set ylabel 'Nombre de photos' set xtics rotate by 90 offset character 0, -1 set style data histograms p 'exifstats_data/focale.dat' u 2:xticlabels(1) set out # ======= OUVERTURE ====== set out 'exifstats_data/aperture.svg' set xlabel 'Ouverture' set ylabel 'Nombre de photos' set xtics rotate by 90 offset character 0, -1 p 'exifstats_data/aperture.dat' u 2:xticlabels(1) set out # ======= ISO ======= set out 'exifstats_data/ISO.svg' set xlabel 'ISO' set ylabel 'Nombre de photos' set xtics rotate by 90 offset character 0, -2 p 'exifstats_data/ISO.dat' u 2:xticlabels(1) set out EOF cat < exifstats.htm Statistiques photo EOF $html_reader exifstats.htm &