Main Menu

Recent posts

#1
The "exiftool" Application / Re: Is there a way to select t...
Last post by wywh - Today at 03:04:11 PM
I have used this workflow. Edit example.config file, if needed.
#2
Other Discussion / Re: Newbie's Plea for Help
Last post by Treat - Today at 03:01:53 PM
Thank you for your follow up.

It would appear that there is currently a connection in the names of the image file and the JSON file.

I am attaching a .jpg file which was part of my data download from Flickr.

Also included in the download was the JSON file   photo_53347553061 which contained the following code:
{
   "id": "53347553061",
   "name": "The Wawa Goose (15 May 2022)",
   "description": "We made the compulsory stop at the Wawa goose. Carlos found that the grass at the far end offer a nice, quiet place to pee.",
   "count_views": "0",
   "count_faves": "0",
   "count_comments": "0",
   "date_taken": "2022-05-15 11:59:18",
   "count_tags": "0",
   "count_notes": "0",
   "rotation": 0,
   "date_imported": "2023-11-21 14:47:45",
   "photopage": "https://www.flickr.com/photos/juniperrock/53347553061/",
   "original": "https://live.staticflickr.com/65535/53347553061_a51c34dbc2_o.jpg",
   "license": "All Rights Reserved",
   "geo": [
   ],
   "groups": [
   ],
   "albums": [
   ],
   "tags": [
   ],
   "people": [
   ],
   "notes": [
   ],
   "privacy": "friend & family",
   "comment_permissions": "any flickr member",
   "tagging_permissions": "people you follow",
   "safety": "safe",
   "comments": [
   ]
}

#3
Hey all, I'm trying to use exiftool to select the highest quality (resolution) preview for a bunch of images. However, these preview types don't seem to be standardized, so I'm trying to figure out if theres a command that selects the best one, or if there's way to sort them by resolution so I can just choose the top one. For example, currently when I run exiftool -j -preview:all myimage.NEF, I get

exiftool -j -preview:all myimage.NEF
[{
  "SourceFile": "myimage.NEF",
  "JpgFromRaw": "(Binary data 1232426 bytes, use -b option to extract)",
  "OtherImage": "(Binary data 601734 bytes, use -b option to extract)",
  "PreviewImage": "(Binary data 109671 bytes, use -b option to extract)",
  "ThumbnailImage": "(Binary data 8336 bytes, use -b option to extract)",
  "PreviewTIFF": "(Binary data 98514 bytes, use -b option to extract)",
  "ThumbnailTIFF": "(Binary data 210 bytes, use -b option to extract)"
}]

but I don't know which one is the highest resolution without downloading all of them, which I don't want to do since I need to do this for a ton of files. Does anyone have any ideas?

I appreciate the help.
#4
Many thanks, Phil!

And for a final request (I hope): My caption is becoming very long... Is there a way to insert a newline? I searched the documentation without success.
#5
Metadata / Re: Need a favor from a Exifto...
Last post by StarGeek - Today at 10:02:43 AM
Alternatively, you could use the Basename tag.
exiftool "-iptc-caption<${Basename;s/^(\d+-)//}" DIR

What these commands are doing is stripping away any leading numbers followed by a dash from the filename. Hopefully, that is what you want done.
#6
The extracted ThumbnailImage and PreviewImage .dat files are not complete HIF files.  They contain only a proprietary header plus the raw hvcC image data.

- Phil
#7
@StarGeek: thanks, the correct link is: https://jottacloud.com/s/1169adcc51758064d6f9d81adc709cbef13
In the subdir 'pv1' are the two output files ofexiftool -a -b -W pv1/%f_%t%-c.%s -preview:all 20250302_144047.170__R5m2-8486.CR3. The command is copied from the thread "https://exiftool.org/forum/index.php?topic=7227.0", ExifToolVersion: 13.32.
The output ofexiftool -a -G1 -s 20250302_144047.170__R5m2-8486.CR3 >20250302_144047.170__R5m2-8486.CR3.txt is of course in the .txt file. The same for exiftool -a -G1 -s 20250302_144047.170_CR5m2-8486.HIF >20250302_144047.170_CR5m2-8486.HIF.txt. It is a guess by me that the format of the preview files is the same as that of the 'HIF' file.
I know that "It didn't work" is very vague. But I tried it with the GUI of Win 11, therefore I don't have any commands to show. And from the outputs only screenshots.
The output form "IrfanView" is: "Can't read file header! Unknown Image Format, empty/damaged file or file doesn't exist!" (translation by me).
The HIF file is only readable with Adobe Lightroom Classic. I tried IrfanView, CaptureOne, Photoshop too. And Adobe Lightroom Classic is the only tool which shows a correct preview of "20250302_144047.170__R5m2-8486.CR3". Only a pale and pink preview of the file "20250302_144047.170_CR5m2-8486.HIF" is shown by Adobe Lightroom Classic.
Kind regards, Hans
#8
Metadata / Re: Need a favor from a Exifto...
Last post by Phil Harvey - July 07, 2025, 07:53:16 PM
Hi Chris,

You want the file descriptor written to the IPTC Caption-Abstract?  The first time I read your post I thought you wanted the descriptor to be set from Caption-Abstract, and I wrote out a whole response then figured you probably meant the other way around.  So here goes again...

The command would be something like this:

exiftool "-iptc-caption<${filename;s/^(\d+-)//;s/\..*//}" DIR

The quoting is for Windows.  But I wouldn't be surprised if you are talking about some tag other than IPTC:Caption-abstract because the old IPTC/NAA is becoming obsolete.  Use exiftool -s on a file that already contains a caption to determine which tag you should be using.

- Phil
#9
The "exiftool" Application / Re: Concatenating several exif...
Last post by Phil Harvey - July 07, 2025, 07:36:41 PM
Here is the command to do what you asked.  There is added complexity to handle the case where Caption-Abstract doesn't exist, and to insert commas before the added keywords only if it does:

exiftool '-caption-abstract<${caption-abstract;s/(.)$/$1, /}${keywords;my @a=split /##/;$_="$a[2], $a[3]"}' -sep ## -m FILE

The quoting is for Unix/Mac.

The -m option causes $Caption-Abstract to return an empty string in the case it doesn't exist in the file, rather than returning an undefined value which would mean the command wouldn't do anything.

The -sep ## is to change the list separator to "##" in case any of the Keywords contains a ", " combination.  If this is not an issue, then the command may be simplified:

exiftool '-caption-abstract<${caption-abstract;s/(.)$/$1, /}${keywords;my @a=split /, /;$_="$a[2], $a[3]"}' -m FILE

- Phil
#10
The "exiftool" Application / Re: Concatenating several exif...
Last post by Kloomnik - July 07, 2025, 06:25:14 PM
Wow!  Thanks for the quick and expert reply.  I am aware of the different metadata groups, but I use EXIF to refer to all tags (as the name EXIFtool suggests :-).

Your example of concatenation was great help!

Assigning values to the metadata fields that will be picked up by Mac Photos is a challenge of "reverse engineering" of sorts. First, I concluded the Photos caption comes from IPTC:Caption-Abstract, but after the concatenation I had to write it to IPT0:ImageDescription...

Now I have another challenge :-)

I have a metadata field [IPTC]:Keywords with 8 keywords separated by commas. Is it possible to extract only the 3 and 4 keywords and append them to the caption?

I am an old Unix hack and can manipulate Unix tools such as sed, cut, awk and so on when needed.

Again, thanks of your help.