Add keywords to image metadata
See original GitHub issueHi!
I want to implement feature that add keywords to image metadata, by icloud album title. For example, I have 10 photos in album named “Test album”, and I want to images have keyword “Test album”, for quick search in Shotwell.
The difficulty in implementing data writing to a file…
I tried via piexif:
exif_dict = piexif.load(path)
exif_dict.get("0th")[40094] = tags // tags is string 'tag1,tag2'
exif_bytes = piexif.dump(exif_dict)
piexif.insert(exif_bytes, path)
and got error
zeroth_set = _dict_to_bytes(zeroth_ifd, "0th", 0)
File "/usr/local/lib/python2.7/dist-packages/piexif/_dump.py", line 337, in _dict_to_bytes
offset)
File "/usr/local/lib/python2.7/dist-packages/piexif/_dump.py", line 193, in _value_to_bytes
value_str = (_pack_byte(*raw_value) +
File "/usr/local/lib/python2.7/dist-packages/piexif/_dump.py", line 162, in _pack_byte
return struct.pack("B" * len(args), *args)
struct.error: cannot convert argument to integer
via iptcinfo:
iptc.keywords = []
tags = [x.strip() for x in tags.split(',')];
iptc.keywords.extend(tags)
iptc.save()
no errors, and no results - tags wasn’t written to file…
Help, please…
Issue Analytics
- State:
- Created 5 years ago
- Comments:8
Top Results From Across the Web
How to add, edit and remove keywords in your photo
Open folder with photos in the left panel. · Select photo(-s) that you want to add keywords. · Click button 'Edit EXIF/IPTC' to...
Read more >Using Image Keywords in your Image Metadata
Whether to include image keywords within image metadata to aid Search Engine Optimisation.
Read more >Adding keyword metadata to photos - Camera Bits
There are three basic methods for adding keyword metadata to photos in Photo Mechanic. You can type keywords directly into the keywords ......
Read more >How To Use Image Metadata And Keywords
Use enough keywords to define and locate the picture but don't waste time adding too many keywords. If you do need to add...
Read more >How to Add Metadata to Images and Video
Open up the folder on your computer that contains the image or video file. · PC users: Right-click on the image, and select...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
yes, manually tagging the photos with album name would work
@RhetTbull that’s amazing! Photos are almost done downloading (will finish overnight) and I was just starting to experiment with tagging my albums by hand. Which was looking pretty tediously slow … so thanks heaps! 😃