Exiftool

Installing ExifTool

In this section, we’ll be installing ExifTool on Ubuntu and other Linux distributions

You can install ExifTool on Ubuntu using the apt utility.

# sudo apt install libimage-exiftool-perl

From Source

You can compile and install ExifTool from the source on any Linux distro (including CentOS)

$ wget https://netix.dl.sourceforge.net/project/exiftool/Image-ExifTool-10.61.tar.gz
$ tar xvf Image-ExifTool-10.61.tar.gz
$ cd Image-ExifTool-10.61/

You can run ExifTool by running in the ExifTool directory or proceed to the next step if you want to install it system-wide. You must have Perl installed on your Linux box before compiling.

# perl Makefile.PL
# make
# make test
# make install

You can now run ExifTool anywhere in your terminal by typing .

Usage

require 'exiftool'
e = Exiftool.new("path/to/iPhone 4S.jpg")
e.to_hash
# => {:make => "Apple", :gps_longitude => -122.47566667, …
e.to_display_hash
# => {"Make" => "Apple", "GPS Longitude" => -122.47566667, …

Multiget support

This gem supports Exiftool’s multiget, which lets you fetch metadata for many files at once.

This can be dramatically more efficient than spinning up the
process for each file due to the cost of spinning up perl.

Supply an array to the Exiftool initializer, then use :

require 'exiftool'
e = Exiftool.new(Dir"**/*.jpg")
result = e.result_for("path/to/iPhone 4S.jpg")
result.to_hash
# => {:make => "Apple", :gps_longitude => -122.47566667, …
result:gps_longitude
# => -122.47566667

Or iterate through files_with_results:

e.files_with_results
# => ["path/to/iPhone 4S.jpg", "path/to/Droid X.jpg", …

Dates without timezones

It seems that most exif dates don’t include timezone offsets, without which forces us to assume the
current timezone is applicable to the image, which isn’t necessarily correct.

To be correct, we punt and return the exiftool-formatted string, which will be something like
.

If the clock was set correctly on your camera, the date will be the correct calendar day
as far as you were concerned when you took the photo. Given that, we
add a key associated to just the calendar date of the field, which should be safe-ish.

require 'exiftool'
e = Exiftool.new("test/IMG_2452.jpg")
e:date_time_original
=> "2011:07:06 09:46:45"
e:date_time_original_civil
=> #<Date: 2011-07-06 ((2455749j,0s,0n),+0s,2299161j)>

When things go wrong

  • is raised if the provided filename doesn’t exist.
  • is raised if isn’t in your .
  • If ExifTool has a problem reading EXIF data, no exception is raised, but will return true:
Exiftool.new("Gemfile").errors?
#=> true

Изменить метаданные PDF в терминале Linux

Существует несколько инструментов для Linux, которые могут редактировать метаданные PDF, включая ExifTool, pdftk, Ghostview и, возможно, другие, но в этой статье мы сосредоточимся на ExifTool, который, на мой взгляд, является самым простым в использовании.

ExifTool — это независимая от платформы библиотека Perl, а также приложение командной строки для чтения, записи и редактирования метаинформации в самых разных файлах. Для документов PDF ExifTool поддерживает запись собственных метаданных PDF и XMP; он поддерживает такие теги:

  • Заголовок
  • Автор
  • Тема
  • Описание
  • Создатель
  • Производитель

Установите ExifTool на Linux:

Debian, Ubuntu, Linux Mint, Pop! _OS, Zorin OS, Elementary OS и любой другой дистрибутив Linux, основанный на Debian или Ubuntu:

1 sudo apt install libimage-exiftool-perl

Fedora:

1 sudo dnf install perl-Image-ExifTool

CentOS / RHEL:

1 sudo yum install perl-Image-ExifTool

Arch Linux, Manjaro:

1 sudo pacman-Sperl-image-exiftool

OpenSUSE:

1 sudo zypper inexiftool

Solus OS:

1 sudo eopkgвperl-image-exiftool

Теперь вы можете редактировать метатеги PDF в Linux с помощью инструмента командной строки ExifTool (это одна команда):

1 exiftool-Title=»PDF Title»-Author=»Author Name»-Subject=»PDF Subject»-Keywords=»keyword1;keyword2″-Creator=»Name of application used to create the PDF»-Producer=»PDF producer name or note»myPDFdocument.pdf

То, что обозначают теги PDF в этой команде, должно быть объяснено уже использованными мною значениями. Не забудьте заменить myPDFdocument.pdf именем (и путем, если он отсутствует в текущем каталоге) файла PDF, для которого вы хотите изменить теги PDF.

Вы можете пропустить некоторые теги, которые я упоминал в этой команде, и в этом случае PDF будет продолжать использовать свой оригинальный тег (если есть). По умолчанию ExifTool создает резервную копию исходного документа PDF, используя его имя и _original. Вы можете пропустить это и перезаписать исходный файл, добавив -overwrite_original к команде.

Вы можете просмотреть полный список тегов, которые ExifTool поддерживает для файлов PDF на этой странице.

ExifTool может также использоваться для чтения тегов метаданных PDF. Чтобы показать все теги PDF с ExifTool, используйте:

1 exiftool-allall myPDFdocument.pdf

Важно отметить, что изменения метаданных, сделанные с помощью ExifTool, являются обратимыми, что является «потенциальной проблемой безопасности, потому что старая информация никогда не удаляется из файла», объясняет страница ExifTool PDF Tags. Однако вы можете навсегда удалить старую информацию метаданных PDF с помощью qpdf, используя:

1 qpdf—linearize in.pdf out.pdf

В этой команде in.pdf — это файл PDF, для которого вы хотите удалить старую информацию метаданных, а out.pdf — имя полученного файла PDF.

В этой статье я рассказал о лучших способах изменения и редактирования метаданных PDF-файлов в Linux. Надеюсь, какой-нибудь из представленных способов удовлетворит ваши потребности.

Cómo editar metadatos con Exiftool en Ubuntu 17

Añadir Copyright o derechos de autora una imagen
Existen determinadas imágenes que son propias de una compañía y al momento de capturar la imagen no es posible crear un Copyright sobre ella para que no sea usada por terceros sin autorización, con Exiftool podremos añadir este valor de Copyright de una forma sencilla y de esta forma hacer propia la imagen.

Para esto usaremos la siguiente línea:

exiftool -rights="Copyright" -CopyrightNotice="Copyright" "Solvetic.jpg"

-rights: Es una abreviatura de -XMP-dc: Rights y permite asignar derechos propios a la imagen.

-Copyrigt: Permite completar el campo ITPD CopyrightNotice

Los parámetros a usar son los siguientes:Al ejecutar este comando veremos lo siguiente:

De forma automática se crea un respaldo de la imagen llamado Solvetic.jpg_original. Debemos tener en cuenta lo siguiente:

  • Exiftool es sensible a las mayúsculas o minúsculas de modo que *.png no es igual a *.PNG
  • Si deseamos evitar que sea creado el archivo de respaldo y escribir los cambios directamente en el archivo usaremos el parámetro adicional -overwrite_original.

De esta forma podremos agregar los derechos de autor a la imagen seleccionada:

exiftool -overwrite_original -rights="2017 Solvetic, Todos los derechos reservados" -CopyrightNotice="2017 Solvetic, Todos los derechos reservados " "solvetic.jpg"

AMPLIAR

Al acceder a la información de los metadatos de la imagen veremos la línea de Copyrights Notice y Rights con el texto ingresado:

AMPLIAR

Añadir del creador o autor de la imagen
Con Exiftool es posible que añadamos al autor de la imagen con el fin de personalizar la propiedad de esta. Para realizar este proceso usaremos la siguiente línea:

exiftool -XMP-dc:Creator="Solvetic Internet" "solvetic.jpg"

AMPLIAR

Podemos ver que se ha añadido el campo Creator con la información suministrada. Si deseamos añadir el creador y los derechos de autor en un solo comando ejecutaremos lo siguiente:

exiftool -overwrite_original -rights="2017 Solvetic, Todos los derechos reservados " -CopyrightNotice="2017 Solvetic, Todos los derechos reservados " -XMP-dc:Creator="Creator" "solvetic.jpg"

Añadir de Creative Commons a la imagen
Estos Creative Commons nos permiten añadir diversos valores de propiedad a la imagen tales como:

Las sintaxis a usar son:

Licencias: exiftool -overwrite_original -XMP-cc:license="http://creativecommons.org/licenses/by-sa/4.0/" "archivo.extension"
URL: exiftool -overwrite_original -XMP-cc:AttributionURL="Creador URL" "archivo.extension"
Nombre de atributo: exiftool -overwrite_original -XMP-cc:AttributionName="Creator" "archivo.extension"

Por ejemplo usaremos la opción de la URL con la siguiente línea:

exiftool -overwrite_original -XMP-cc:AttributionURL="www.solvetic.com” "solvetic.jpg"

AMPLIAR

Si observamos los metadatos veremos la URL añadida:

AMPLIAR

5. Cómo eliminar todos los metadatos con Exiftool en Ubuntu 17

Finalmente si deseamos eliminar toda la información de los metadatos podremos usar las siguientes opciones:

Eliminar metadatos de un solo archivo

exiftool -all= -overwrite_original "archivo.extension"

Eliminar metadatos de un directorio

exiftool -all= -overwrite_original

Eliminar todos los metadatos de una determinada extensión en un directorio

exiftool -all= -overwrite_original -ext (tipo extensión, png, jpg, etc)

El resultado obtenido al eliminar todos los metadatos será el siguiente:

AMPLIAR

Nota
En el enlace oficial de Exiftool encontraremos todos los formatos soportados y el tipo de soporte ofrecido por Exiftool (Lectura o Escritura): Exiftool

Usando esta práctica herramienta tendremos la posibilidad de editar los metadatos de los objetos multimedia alojados en ambientes Linux y Windows 10. Si también te interesa en ambientes de Apple, aquí tienes cómo borrar metadatos en sistemas macOS.

Performance

The target reads all tags found in a batch of sample images and
parses the results.

Using :

Read 2236 unique tags from 3011 files.
Parsing took 16191ms (5.4ms / file) # win32, core i7, maxProcs 4
Parsing took 27141ms (9.0ms / file) # ubuntu, core i3, maxProcs 1
Parsing took 12545ms (4.2ms / file) # ubuntu, core i3, maxProcs 4

Using the npm package takes 7x longer (and doesn’t work on Windows):

Reading 3011 files...
Parsing took 85654ms (28.4ms / file) # ubuntu, core i3

Batch mode

Using ExifTool’s batch mode means we can reuse a single
instance of ExifTool across many requests, dropping response latency
dramatically as well as reducing system load.

Parallelism

To avoid overwhelming your system, the singleton is configured with a
set to a quarter the number of CPUs on the current system (minimally
1); no more than instances of will be spawned. If the
system is CPU constrained, however, you may want a smaller value. If you have
very fast disk IO, you may see a speed increase with larger values of
, but note that each child process can consume 100 MB of RAM.

Configuration

You can manually set the exiftool command that should be used via

MiniExiftool.command = '/path/to/my/exiftool'

In addition, you can also tell MiniExiftool where to store the PStore files with tags
which exiftool supports. The PStore files are used for performance issues.
Per default the PStore files are stored in a sub directory or
under your home directory.

MiniExiftool.pstore_dir = '/path/to/pstore/dir'

If you’re using Rails, this is easily done with

MiniExiftool.pstore_dir = Rails.root.join('tmp').to_s

Important hint: if you have to change the configuration you have to do this direct
after .

Windows

In Windows, there is a choice of two different versions of ExifTool to
install. The Perl distribution requires Perl to be installed on your system.
(A good, free Perl interpreter can be downloaded from
activeperl.com.)

If you don’t already have Perl, it is easier to install the stand-alone ExifTool
executable, but note that the stand-alone version doesn’t include the HTML
documentation or some other files of the full distribution.

Stand-Alone Executable

  1. Download the Windows Executable from the ExifTool home page.
    (The file you download should be named «».)
  2. Extract «» from the
    «» file, and place it on your Desktop.
    (Double-click on «» to open
    the archive, then drag «» to your Desktop.)

You can now double-click on «» to read the
application documentation, or drag-and-drop files and folders to run exiftool on
selected files. To install exiftool for use from the command line,
continue with the following steps:

  1. Rename «» to «».
    (or «» to «» if file name
    extensions are hidden on your system)
  2. Move «» to the «» directory
    (or any other directory in your PATH).

You can now run exiftool by typing «» at the command
prompt. (To get to the command prompt, select «Run…» from the Windows «Start»
menu, then type «» and press Return.)

Notes:

  1. In Windows 7, running exiftool may require administrator privileges. If
    necessary, this may be enabled by right clicking on exiftool, then selecting
    «Run this program as administrator» from the Compatibility settings.
  2. Windows 10 users have sometimes reported that exiftool hangs when run.
    This may be due to Windows Defender blocking or slowing down exiftool. To solve
    this, either disable Windows Defender or add an exclusion for exiftool (but note
    that exiftool may still run more slowly if you just add an exclusion).
  3. Occasionally users have reported that exiftool gives errors when running
    this version for this first time. It is possible this may happen if the
    installation process gets interrupted. In this case, follow the Uninstalling
    instructions below then re-install exiftool. Be sure that you have sufficient
    disk space in your TEMP directory for exiftool to unpack about 12 MB of
    temporary files — these are the Perl libraries used by the exiftool application
    which are unpacked the first time exiftool is run.

Uninstalling:

  1. Drag «» (or «»)
    into the Recycle bin.
  2. Drag the directory «» from your temporary directory to
    the Recycle bin. Here «» is your user name (in ASCII-hex for
    ExifTool 10.21 or later) and the location of the temporary directory depends on
    the value of the TEMP environment variable (typically
    «»
    for Windows XP, or «» for Windows 7
    or later).

Full Perl Distribution

You must have Perl installed to use this version. (A free version of Perl
can be downloaded from
activeperl.com.)

  1. Download the Image-ExifTool distribution from the ExifTool home page
    (The file you download should be named «».)
  2. Extract the ExifTool files from the archive.
    (The archive is a gzipped tar file, and can be opened with
    various Windows utilities, including WinZip.)
  3. Rename «» to «»
    in the exiftool distribution.
  4. Move «» and the «»
    directory from the exiftool distribution to «»
    (or any other directory in your PATH).

Now, if you have made the proper Windows associations for the
«» extension (an option in the ActivePerl installation), you
can run exiftool by typing «» at the
«» prompt. Otherwise you should type
«».

Uninstalling:

  1. Drag «» and
    «» into the Recycle bin. You should first confirm
    that «» contains only the «»
    and «» sub-directories. Do not delete it if it
    contains anything else.

Export/Import menu

Copy metadata into all JPG or TIF files

No matter how many destination files you select (you must select at least one for menu to be enabled), metadata will always be copied into all JPG or TIF (but not both) files inside current folder. That is, this option behaves as if all JPG or TIF files are selected in Scenario 2 above.
After you choose this menu option, you’ll be first asked «should files in subfolders also be processed?«. If we choose No, then again, this option behaves the same way as if all files are selected in Scenario 2 above. However, if we coose Yes, then metadata will be copied into images in all subfolders as well (only where folder/file names are equal, of course).

jpgrawMyJpg\Dir1Copy metadata into all JPG or TIF filesYesMyRaw\Dir1Note:wishNote:ExecuteMyJpg\Dir1Dir2MyRaw\Dir1Dir2NoMyJpg\Dir1

Import GPS data from : Log files

supported GPS filesStep 1:Select log fileStep 2:use all log files in directoryStep 3:Reference DateTime valueStep 4:TimeZone offset

  • Case A: Photos are taken in your local (time) area
    -in this case there’s no need to use TimeZone offset option. Short explanation: if TimeZone offset option doesn’t exist, ExifTool «assumes» that camera time and PC’s system time have the same TimeZone offset and ExifTool will handle logged UTC time automatically.
  • Case B: Photos are taken somewhere outside your local TimeZone area
    -in this case you must use TimeZone offset option. Example: if you live in New York and photo was taken in Vienna, then you must set TimeZone offset to +01 (depending on winter/summer time?)

here

Import GPS data from : Xmp files

Note:Sort files by file extension (so, for example, JPG and XMP files are grouped -not mixed) or use desired file type filter (i.e. «CR2 files only»). The only reason for doing this is: you can select (only) image files easier.
Select all image files you wish to modify.
After choosing menu Import GPS data from xmp file(s), you’ll be prompted to select folder containing (xmp) sidecar files -in most cases, that will be the same folder where image files reside.

4. Как редактировать метаданные с помощью Exiftool в Ubuntu 17

Добавить Авторское право или авторские права на изображение

Существуют определенные изображения, которые являются типичными для компании, и при захвате изображения невозможно создать на нем авторское право, чтобы оно не использовалось третьими лицами без разрешения, с помощью Exiftool мы можем добавить это значение авторского права простым способом и таким способом. Сделайте изображение своим.

Для этого мы будем использовать следующую строку:

 exiftool -rights = "Авторское право" -CopyrightNotice = "Авторское право" "Solvetic.jpg" 

-rights: это аббревиатура от -XMP-dc: Rights и позволяет вам назначать свои права на изображение.

-Copyrigt: позволяет заполнить поле ITPD CopyrightNotice

Резервная копия образа под названием Solvetic.jpg_original создается автоматически

Мы должны принять во внимание следующее:

  • Exiftool чувствителен к регистру, поэтому * .jpg не равен * .PNG
  • Если мы хотим предотвратить создание файла резервной копии и записать изменения непосредственно в файл, мы будем использовать дополнительный параметр -overwrite_original.
 exiftool -overwrite_original -rights = " 2017 Solvetic, Все права защищены" -CopyrightNotice = " 2017 Solvetic, Все права защищены" "solvetic.jpg" 

При доступе к информации метаданных изображения мы увидим строку Уведомление об авторских правах и правах с введенным текстом:

Добавьте от создателя или автора изображения

С помощью Exiftool мы можем добавить автора изображения, чтобы персонализировать свойство изображения. Для выполнения этого процесса мы будем использовать следующую строку:

 exiftool -XMP-dc: Creator = "Solvetic Internet" "solvetic.jpg" 

Мы видим, что поле «Создатель» было добавлено с предоставленной информацией. Если мы хотим добавить создателя и авторское право в одной команде, мы выполним следующее:

 exiftool -overwrite_original -rights = " 2017 Solvetic, Все права защищены" -CopyrightNotice = " 2017 Solvetic, Все права защищены" -XMP-dc: Creator = "Creator" "solvetic.jpg" 

Добавьте Creative Commons к изображению

Эти Creative Commons позволяют нам добавлять различные значения свойств к изображению, такие как:

URL создателя

лицензирование

Имя атрибута и т. Д.

Синтаксис для использования:

 Лицензии: exiftool -overwrite_original -XMP-cc: license = "http://creativecommons.org/licenses/by-sa/4.0/" "file.extension" URL: exiftool -overwrite_original -XMP-cc: AttributionURL = "Создатель URL "" file.extension "Имя атрибута: exiftool -overwrite_original -XMP-cc: AttributionName =" Creator "" file.extension " 
 exiftool -overwrite_original -XMP-cc: AttributionURL = "www.solvetic.com" "solvetic.jpg" 

Если мы посмотрим на метаданные, то увидим добавленный URL:

Особенности ExifTool

  • Мощный, быстрый, гибкий и настраиваемый
  • Поддерживает огромное количество различных форматов файлов
  • Читает EXIF, GPS, IPTC, XMP, JFIF, MakerNotes, GeoTIFF, ICC Profile, Photoshop IRB, FlashPix, AFCP, ID3 и многое другое…
  • Записывает EXIF, GPS, IPTC, XMP, JFIF, MakerNotes, GeoTIFF, ICC Profile, Photoshop IRB, AFCP и многое другое…
  • Читает и записывает заметки производителей многих цифровых камер
  • Декодирует загадку, завернутую в тайну внутри загадки
  • Многочисленные параметры форматирования вывода (включая разделители с табуляцией, HTML, XML и JSON)
  • Многоязычный вывод (cs, de, en, en-ca, en-gb, es, fi, fr, it, ja, ko, nl, pl, ru, sv, tr, zh-cn или zh-tw)
  • Geotags изображения из GPS файлов журнала отслеживания (с коррекцией по времени)!
  • Генерирует журналы отслеживаний из geotagged изображений
  • Сдвигает значения даты / времени для фиксации временных меток в изображениях
  • Переименовывает файлы и организует их в каталогах (по дате или любой другой метаинформации)
  • Извлекает уменьшенные изображения, изображения предварительного просмотра и большие изображения JPEG из файлов RAW
  • Копирует метаинформацию между файлами (даже файлами разных форматов)
  • Читает/записывает структурированную XMP информацию
  • Удаляет метаинформацию по отдельности, в группах или в целом
  • Устанавливает дату изменения файла (и дату создания в Windows) из информации EXIF
  • Поддержка альтернативных языковых тегов в XMP, PNG, ID3, Font, QuickTime, ICC Profile, MIE и MXF информация
  • Обрабатывает целые деревья каталогов
  • Создает текстовый выходной файл для каждого файла изображения
  • Создает файлы двоичного формата только для метаданных (MIE) для резервного копирования метаданных
  • Автоматическое резервное копирование исходного изображения при записи
  • Организует вывод в группы
  • Условно обрабатывает файлы на основе значения любой метаинформации
  • Возможность добавления настраиваемых пользовательских тегов
  • Поддержка MWG (Metadata Working Group) рекомендаций
  • Распознавание тысяч различных тегов
  • Протестировано изображениями с тысяч различных моделей камер
  • Расширенные подробные и шестнадцатеричный дампы выходов на основе HTML.

Это интересно:

  • Как попасть в Darknet? Полное Руководство !
  • Лучшие хакерские программы
  • Как взломать wi fi с телефона

Примеры команд:

Вывести всю информацию о файле img.jpg

В виде атрибутов и значений

В виде только значений

Теперь добавляем любой атрибут из списка из прошлой команды:

Выведем дату создания файла из exif атрибута:

Или выведем дату создания файла:

Выведем имя файла и обе даты:

По умолчанию мы увидим атрибут только в том случае если он заполнен, если надо показать содержимое в любом случае дописываем в команду -f это выведет все данные даже если какой-то атрибут пустой.

Теперь про директории…

Выведем имя, и обе даты создания для всех файлов в текущей дитектории:

или в определенной директории:

Если нужно сканировать еще и подпапки добавляем -r рекурсивно.

А теперь давайте изменим формат даты. Для этого добавляем -d и далее формат

Если мы хотим вывести информацию в произвольном формате, можно использовать -p ‘какой-то текст из файла $FileName’ где в название переменной это атрибуты

Условия if else?

Да, тут есть и условия -if ‘какое-то условие’ тогда обработка этого файла выполняется, в противном случае не выполняется.

Какие свойства имеются:

not — отрицание например ‘not $CreateDate’or — илиand — иeq — equivalent что-то типа =

Если хочется перенести все файлы из всех подпапок в текущую папку, делаем так:

или так

А если файлы повторяются оно их заменит или что?

Сделаем если будут файлы повторяться чтобы добавлялось число перед расширением.%f это название файла без расширения%-3c это добавляет -001 если с таким же именем уже есть. 3 означает сколько символов. По сути можно написать только %c%e это расширениеЗаметка: это не переносит файл а копирует его.

В подпапку

или так:

Если хотим отсортировать по полной дате:

Теперь сортируем по папкам с датой

Если хотим отсортировать по папкам по годам, месяцам и тд, то добавляем вывод даты в формате который хотим.

или так:

Можно и само название файла поменять под дату, но надо не забыть добавить в конце формат файла %e

Но что будет с файлами где $DateTimeOriginal пустое — ничего. Покажет ошибку для них. В таком случае лучше всего добавить проверку на существование.

А вот с проверкой но с оригинальным названием файла:

или так:

Все эти команды переносят файлы, а как же скопировать файл а не переносить? добавляем -o .

Добавляем так же числовой номер если такой файл в папке существует:%f это название файла без расширения%-3c это добавляет -001 если с таким же именем уже есть%e это расширение

Program menu

Preferences

GeneralMetadata languageMetadataExifTool directLog windowLet GUI rotate JPG preview imagePreviewEnabling internet accessGoogleMapDefault Startup & Export folderSeparator characteryourSave Filelist Details state on exitDetails:Thumbnails sizeOtherWorkspace: Move focus to next tag/line after value is entered

Workspace manager

MetadataWorkspaceExifTool directTag name column#*Hint textMetadataWorkspaceFill in default values?Note:Workspace±Note:Tag definition column-exif:Orientation#Workspace-GUI-SEPHint text columnshortWorkspace manager

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *