Hi there
I'm setting up a mysql database to catalogue my photos to run through a php interface to a browser. I'd like to include a thumbnail so I can categorize, rate and otherwise find my stuff reliably and interact with Photos on a mac and various editing tools. So, need to figure out how to get the output from "exiftool -r -T -b -filename -Thumbnailimage > TN.txt" into mysql but the format of the -ThumbnailImage output gets tricky with mysql "LOAD DATA". I've seen some posts using perl, though I don;'t know perl. Is there a way to do this in a simple script?
Thx
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I would think that you would want to extract the Thumbnail separately from the file name, as this command line creates a single file that combines both the binary data of the Thumbnail and the text data of the Filename.
But there are multiple ways to extract the thumb nail. If you are going to write the thumbnail to a file, you could use this example, changing preview:all into Thumbnail. See the -w (-TextOut) option for the format codes. Or you could just capture the binary data directly which would be returned from the command. That would depend upon what programming language you're using. Similarly, you could capture or write the output by using the -j (-json) option or the -X (-xmlFormat). These will return JSON/XML data with the binary data included in Base64. Your programming language should include options to extract the data from those formats.
Last edit: StarGeek 2022-02-21
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi there
I'm setting up a mysql database to catalogue my photos to run through a php interface to a browser. I'd like to include a thumbnail so I can categorize, rate and otherwise find my stuff reliably and interact with Photos on a mac and various editing tools. So, need to figure out how to get the output from "exiftool -r -T -b -filename -Thumbnailimage > TN.txt" into mysql but the format of the -ThumbnailImage output gets tricky with mysql "LOAD DATA". I've seen some posts using perl, though I don;'t know perl. Is there a way to do this in a simple script?
Thx
I would think that you would want to extract the
Thumbnail
separately from the file name, as this command line creates a single file that combines both the binary data of theThumbnail
and the text data of theFilename
.But there are multiple ways to extract the thumb nail. If you are going to write the thumbnail to a file, you could use this example, changing
preview:all
intoThumbnail
. See the-w
(-TextOut
) option for the format codes. Or you could just capture the binary data directly which would be returned from the command. That would depend upon what programming language you're using. Similarly, you could capture or write the output by using the-j
(-json
) option or the-X
(-xmlFormat
). These will return JSON/XML data with the binary data included in Base64. Your programming language should include options to extract the data from those formats.Last edit: StarGeek 2022-02-21