Menu

thumbnails in mysql

Newbies
2022-02-21
2022-02-21
  • Jon Erik Ween

    Jon Erik Ween - 2022-02-21

    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

     
  • StarGeek

    StarGeek - 2022-02-21

    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

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.