ExifTool Forum

ExifTool => Newbies => Topic started by: Harald on July 06, 2017, 08:56:54 AM

Title: write image preview to a CSV file
Post by: Harald on July 06, 2017, 08:56:54 AM
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.
Title: Re: write image preview to a CSV file
Post by: Phil Harvey on July 06, 2017, 09:17:30 AM
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
Title: Re: write image preview to a CSV file
Post by: Harald on July 07, 2017, 11:09:49 AM
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
Title: Re: write image preview to a CSV file
Post by: Phil Harvey on July 07, 2017, 11:11:39 AM
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
Title: Re: write image preview to a CSV file
Post by: Harald on July 10, 2017, 02:06:09 PM
sure. I will send it to you by mail, as I do not want to make data of our organisation public.
Title: Re: write image preview to a CSV file
Post by: Harald on July 11, 2017, 12:47:47 PM
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.
Title: Re: write image preview to a CSV file
Post by: StarGeek on July 11, 2017, 12:51:56 PM
Phil is also offline (https://exiftool.org/forum/index.php/topic,8409.msg43213.html#msg43213) for a couple weeks.
Title: Re: write image preview to a CSV file
Post by: Phil Harvey on July 17, 2017, 09:05:12 AM
Hi Harald,

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

- Phil
Title: Re: write image preview to a CSV file
Post by: Harald on August 04, 2017, 02:46:37 PM
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.