# exif



## balanga (Mar 2, 2020)

I was trying sort out a large number of photographs today and wondered if there was any way of finding the origin of a photograph and came across something called *exif*....Never having heard of it before I tried `pkg install -y exif`  and lo and behold a copy of graphics/exif appeared on my computer!

Isn't FreeBSD fantastic?!


----------



## Bobi B. (Mar 3, 2020)

graphics/p5-Image-ExifTool provides excellent exiftool(1).


----------



## balanga (Mar 4, 2020)

The pkg seems to be fearure rich and it took me some find to work out how to this, but you can display which camera produced various photos using:-

`exiftool "-Make" "-Model" *`


----------



## Criosphinx (Mar 4, 2020)

Whit the default options x11-fm/thunar/ installs graphics/libexif/ you can right clic any picture Properties -> Image and get exif info:






Other file managers like caja and pcmanfm do the same. See the list of "required by" for libexif


----------



## balanga (Mar 4, 2020)

I  was just wondering if there was any way to view exif data from within misc/mc and there seems to be script called image.sh which can be invoked by pressing F3 on a jpg, but that doesn't seem to be included with the FreeBSD release.... Does anyone know if it does exist? Or could I use one from a Linux release?


..... a few minutes later.... actually the file does exist. I was misled by the error msg which popped up:-


```
│                                                 ┌────────────────────────── Error ──────────────────────────┐                                                                  │                                                    │
│                                                 │                                                           │                                            │       │            │
│                                                 │ /usr/local/libexec/mc/ext.d/image.sh: identify: not found │                                            │       │          │
│                                                 │                                                           │                                            │       │            │
│                                                 │                                                           │                                            │       │            │
│                                                 └───────────────────────────────────────────────────────────┘
```


----------



## SirDice (Mar 4, 2020)

Just read the script itself to see what it does, it's /usr/local/libexec/mc/ext.d/image.sh.


----------



## Bobi B. (Mar 5, 2020)

identify(1) is part of ImageMagick (graphics/ImageMagick7 or graphics/ImageMagick7-nox11).


----------



## balanga (Mar 6, 2020)

Now that I have become a little more familiar with exif data, I would like to convert the filenames of all my jpegs to the value of *Date and Time * from the exif data. Does anyone know of an existing script for changing the filename? It probably isn't too complicated, so I will have a go, but if something already exists, it would probably be better...


----------



## T-Daemon (Mar 6, 2020)

balanga said:


> I would like to convert the filenames of all my jpegs to the value of *Date and Time * from the exif data. Does anyone know of an existing script for changing the filename?


Doesn't graphics/p5-Image-ExifTool has the means to do what you want? From exiftool(1):

```
RENAMING EXAMPLES
...
exiftool    '-FileName<CreateDate' -d %Y%m%d_%H%M%S%%-c.%%e    dir
        Rename all images in "dir" according to the    "CreateDate" date and
        time, adding a copy    number with leading '-'    if the file already
        exists ("%-c"), and    preserving the original    file extension (%e).
        Note the extra '%' necessary to escape the filename    codes (%c and
        %e)    in the date format string.
```
Also from exiftool(1):

http://owl.phy.queensu.ca/~phil/exiftool/filename.html

Notice the dry-run function *TestName* at example 0 before applying the command definitive on the original data.

Tip: It's always best to read the manual of the tool used. When the text is to long at least glance through, look if there is a example section, when seeking a function perform a keyword search. exiftool comes with dozens of man pages, see /usr/local/lib/perl5/site_perl/man/man3/Image::ExifTool::xxxxx, or run `apropos ExifTool`, the one or other might interest you.


----------

