Skip to content

Instantly share code, notes, and snippets.

@flavioamieiro
Created November 17, 2012 22:23
Show Gist options
  • Save flavioamieiro/4100745 to your computer and use it in GitHub Desktop.
Save flavioamieiro/4100745 to your computer and use it in GitHub Desktop.
Extrair JPEG do header de um arquivo raw da Canon (CR2)
#!/bin/bash
find . -name '*.CR2' -print0 | while read -r -d '' FILE
do
BASENAME=$(basename -s ".CR2" "$FILE")
exiftool -b -previewImage -ext .CR2 -w .JPG "$FILE"
exiftool -tagsFromFile "$FILE" "$BASENAME".JPG
done
@flavioamieiro
Copy link
Author

O formato de imagens Raw da Canon inclui no header um JPEG do mesmo tamanho da imagem original. Esse script procura todos os arquivos com a extensão CR2 a partir do diretório atual, extrai o JPEG do header, e copia o resto do cabeçalho pro JPEG.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment