write image preview to a CSV file

Started by Harald, July 06, 2017, 08:56:54 AM

Previous topic - Next topic

Harald

Hi Phil,
I try to write a list of image metadata to a CSV file with a preview of the image (could be the embedded thumbnail or ideally a preview generated by Exiftool with given dimensions).
I could not find any reference for that. When I did this:
exiftool -r -a -b -CSV -XMP:CreateDate -XMP:DateTimeOriginal -EXIF:CreateDate -FILE:filename  -FILE:Directory  -ThumbnailImage ./2015/USA/California/IMG_3684.JPG > demo.csv
It likely wrote the image into the CSV, but Excel interpreted it as text and showed only garbage.
Is something like this possible just using Exiftool or combining Exiftool with Mac OS Terminal?
Thx for your help in advance.

Phil Harvey

Hi Harald,

Right.  The -csv option is incompatible with -b (CSV format doesn't support binary data).  I will remove the "use -b option to extract" from the -csv output for binary data values and make it an error to use -b with -csv.

If you want binary data output, you can use -json or -X format.  Binary data in these outputs is encoded as Base64.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Harald

Thanks Phil. And I guess you are not aware of a way to create a CSV file that contains an image preview? Assetbank offers this in the export feature and as they use Exiftool I thought there might be an option. But I guess they did some extra programming to make that happen.
In that case I would have to upload all 5000 images to Assetbank and then export from there and delete the 5000 afterwards. Can be done, but I would have liked to avoid the effort.
In any case, thanks a lot for your help

Phil Harvey

It would be very useful if you could attach a CSV from Assetbank that contains binary data.

Sure there are ways to do this by ASCII-encoding the binary data (base 64 for example), but I need to know the details of the encoding.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Harald

sure. I will send it to you by mail, as I do not want to make data of our organisation public.

Harald

Hi Phil, I have sent you the file yesterday. Hope you got it. I will be offline from Thursday for 3 weeks. So my reply to your findings will take some time.

StarGeek

* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Phil Harvey

Hi Harald,

You sent an XLSX file.  I thought we were talking about a CSV file.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Harald

Hi Phil,
sorry for the late reply, just returned to office.
And yes, you are right, of course. I mixed up .CSV an .XLSX as I always generate CSV with Exiftool but then process them with Excel.
Indeed, Assetbank does export and Excel file and that might be the reason why they can place the previews. I guess this is not an easy task, as Microsoft file formats for sure are rather cryptic, right?
If so, no worries, then I will keep going via Assetbank to get the Excel sheet with previews.