Exiftool - comandos de escrita

De Pontão Nós Digitais
Revisão de 14h03min de 19 de junho de 2015 por Felipecabral (discussão | contribs)
(dif) ← Edição anterior | Revisão atual (dif) | Versão posterior → (dif)
Ir para navegaçãoIr para pesquisar
A versão imprimível não é mais suportada e pode ter erros de renderização. Atualize os favoritos do seu navegador e use a função de impressão padrão do navegador.

Abaixo estão alguns dos principais comandos de escrita em arquivos de metadados processados pelo exiftool. Talvez algumas situações não estejam contempladas aqui, mas você pode consultar o man para ver a documentação completa. Note que as aspas são necessárias para aplicação de alguns argumentos, em especial aqueles que contêm determinados caracteres especiais, tais como >, |, / , <, etc ou qualquer espaço em branco. Estas necessidades são dependencias do shell unix, mas os exemplos abaixo vão funcionar para a maioria terminais de comando. Com os cmd shell do Windows, no entanto, aspas duplas deve ser utilizadas por padrão, ao passo que em distro linux aspas simples funcionam bem (Exemplo linux: -Comment = 'Este é um novo comentário' | Exemplo cmd: -Comment = "Este é um novo comentário").

  • Escreve um novo comentário em uma imagem jpg (substitui qualquer comentário existente).
 exiftool -Comment='novo comentário' foto.jpg
  • Remove comentários de todas as fotos jpg em um determinado diretório, escrevendo as imagens modificadas em um novo diretório.
 exiftool -comment= -o /novo/diretorio -ext jpg .
  • Substitui palavras-chave existentes por duas novas palavras chaves.
 exiftool -keywords=palavra1 -keywords=palavra2 foto.jpg
  • Copia uma imagem-fonte para um novo arquivo e adiciona uma palavra chave a lista atual de palavras-chave. Repare que o acréscimo é processado pelo sinal +=
 exiftool -Keywords+=nova-palavra -o foto-nova.jpg foto-original.jpg
  • Diminui o valor da tag ExposureCompensation para menos 0,5 EV. Note-se que += é para acrescentar informação e +=- é para acrescentar a diminuição de um valor que virá a seguir. Já o operador -= é usado para deleção condicional. (veja o próximo exemplo)
 exiftool -exposurecompensation+=-0.5 foto.jpg
  • Deleta informações de créditos de todos os arquivos em um diretório onde o valor é xxx.
 exiftool -credit-=xxx /diretorio
  • Write alternate language for XMP:Description, using HTML character escaping to input special characters.
 exiftool -xmp:description-de='kühl' -E dst.jpg
  • Delete all meta information from an image. Note: You should NOT do this to RAW images (except DNG) since proprietary RAW image formats often contain information in the makernotes that is necessary for converting the image.
 exiftool -all= dst.jpg
  • Delete all meta information from an image and add a comment back in. (Note that the order is important: -comment='lonely' -all= would also delete the new comment.)
 exiftool -all= -comment='lonely' dst.jpg
  • Delete all meta information except JFIF group from an image.
 exiftool -all= --jfif:all dst.jpg
  • Delete Photoshop meta information from an image (note that the Photoshop information also includes IPTC).
 exiftool -Photoshop:All= dst.jpg
  • Recursively delete all XMP-crss information from images in a directory.
 exiftool -r -XMP-crss:all= DIR
  • Set the thumbnail image from specified file (Note: The quotes are necessary to prevent shell redirection).
 exiftool '-ThumbnailImage<=thumb.jpg' dst.jpg
  • Recursively write JPEG images with filenames ending in _JFR.JPG to the JpgFromRaw tag of like-named files with extension .NEF in the current directory. (This is the inverse of the -JpgFromRaw command of the READING EXAMPLES section above.)
 exiftool '-JpgFromRaw<=%d%f_JFR.JPG' -ext NEF -r .
  • Adjust original date/time of all images in directory dir by subtracting one hour and 30 minutes. (This is equivalent to -DateTimeOriginal-=1.5. See Image::ExifTool::Shift.pl for details.)
 exiftool -DateTimeOriginal-='0:0:0 1:30:0' dir
  • Add 3 hours to the CreateDate and ModifyDate timestamps of two images.
 exiftool -createdate+=3 -modifydate+=3 a.jpg b.jpg
  • Shift the values of DateTimeOriginal, CreateDate and ModifyDate forward by 1 hour and 30 minutes for all Canon images in a directory. (The AllDates tag is provided as a shortcut for these three tags, allowing them to be accessed via a single tag.)
 exiftool -AllDates+=1:30 -if '$make eq "Canon"' dir
  • Write a tag to the XMP group of two images. (Without the xmp: this tag would get written to the IPTC group since City exists in both, and IPTC is preferred by default.)
 exiftool -xmp:city=Kingston image1.jpg image2.nef
  • Delete LightSource tag only if it is unknown with a value of 0.
 exiftool -LightSource-='Unknown (0)' dst.tiff
  • Set WhiteBalance to Tungsten only if it was previously Auto.
 exiftool -whitebalance-=auto -WhiteBalance=tung dst.jpg
  • Write a new comment only if the image doesn't have one already.
 exiftool -comment-= -comment='new comment' a.jpg
  • Create XMP meta information data files for all images in dir.
 exiftool -o %d%f.xmp dir
  • Create an XMP data file only from tags defined on the command line.
 exiftool -o test.xmp -owner=Phil -title='XMP File'
  • Write ICC_Profile to an image from a .icc file of the same name.
 exiftool '-ICC_Profile<=%d%f.icc' image.jpg
 exiftool -hierarchicalkeywords='{keyword=one,children={keyword=B}}'
  • Delete any trailer found after the end of image (EOI) in a JPEG file. A number of digital cameras store a large PreviewImage after the JPEG EOI, and the file size may be reduced significantly by deleting this trailer. See the JPEG Tags documentation for a list of recognized JPEG trailers.
 exiftool -trailer:all= image.jpg