jeudi 12 juillet 2012

Mettre un stamp sur une image

Avec convert (de Imagemagick), fonctionne bien avec la version :

$convert --version
Version: ImageMagick 6.5.7-8 2009-11-26 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
Features: OpenMP


#!/bin/bash
# stamp timbre A_marquer Img_finale

# (c) 2007-2010 by C.M.
# under the GPL License

# prendre deux fichiers d'images
# l'un étant un "sceau" et l'autre une photo
# et marquer la photo du sceau, en bas à droite (ou gauche)
# Image timbre
SCEAU="$1"
# Image à marquer
PIC="$2"
# Fichier de sortie
OUT_IMAGE="$3"
# Proportion du timbre par rapport à l'image
SCALE="/ 20"
# Texte ajouté sous le timbre
TEXTE=""


# dimensions de l'image à marquer
width_pic=`identify -format %w "$PIC"`
height_pic=`identify -format %h "$PIC"`

# dimensions du sceau
width_sceau=`identify -format %w "$SCEAU"`
height_sceau=`identify -format %h "$SCEAU"`

# dimensions auxquelles réduire le sceau
stamp_w=$(( $width_pic $SCALE * 2))
stamp_h=$(( $height_pic $SCALE))



Install NetBSD via clef USB


Voici le challenge :


créer une clef usb bootable en NetBSD, en n'ayant qu'une seule clef dispo et pas de machine netbsd sous la main. Le principal problème est de formater la clef USB dans le bon format (et pas de mkfs dispo pour ce systeme de fichier BSD)


Solution trouvée :


booter netbsd-Live en virtualisé dans Qemu pour transférer vers le disque dur virtuel de Qemu les fichiers à copier sur la clef usb, puis formater la clef usb et y remettre les fichiers de boot.

Nettoyer les metadonnées d'images

j'ai pour cela trouvé jhead :
jhead -purejpg [img.jpg]
jhead is used to display and manipulate data contained in the Exif header of JPEG images from digital cameras. By default, jhead displays the more useful camera settings from the file in a user-friendly for‐ mat. jhead can also be used to manipulate some aspects of the image relating to JPEG and Exif headers, such as changing the internal timestamps, removing the thumbnail, or transferring Exif headers back into edited images after graphical editors deleted the Exif header. jhead can also be used to launch other programs, similar in style to the UNIX find command, but much simpler.

Command(s) of the day

Some colleagues started putting commands on the white-board every X days under
  • comm compare two sorted files line by line
  • paste merge lines of files
  • colordiff diff, with colors
  • colorgcc
  • pgrep look for a process name
  • pkill kill processes by name, not by pid
  • ...