February 1st, 2013, 04:06 AM
Adding Comments to JPEG files via Python
Hi all! I need some help regarding JPEG files and their descriptions.
Here's the deal, I have about 4-5 thousand JPEG images that I need to add descriptions to. I also have a .txt file and an Excel file that has a list of all the picture files with their filenames, and the description is written for each one. I need those descriptions on the picture files themselves, within their metadata.
Rather than manually adding comments to thousands of pictures, describing what's on each picture, I was wondering if it was possible to make a Python function do all the work. I need Python to edit the metadata of each of the pictures and add the appropriate comment/description (written both in the .txt file and the Excel table) to each one of them.
I presume it's possible, I just need some advice and a good starting point from the more skilled people around here. Please help, thank you!
February 1st, 2013, 07:49 AM
I'd use a shell script with imagemagick convert
$ convert picture0.jpg -comment "pretty as a" t.jpg
$ mv t.jpg picture0.jpg
[/code] are essential for python code and Makefiles!