File: lazygal-setcomment.py

package info (click to toggle)
lazygal 0.9.3-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,980 kB
  • sloc: python: 5,731; xml: 1,159; sh: 18; makefile: 5
file content (16 lines) | stat: -rwxr-xr-x 371 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env python

import sys

from lazygal.pygexiv2 import GExiv2
from lazygal import py2compat

fn = sys.argv[1]
comment = sys.argv[2]

im = GExiv2.Metadata(py2compat.u(fn))

# Assume comment is in utf-8, more encoding processing example using
# sys.stdin.encoding and example processing in lazygal/metadata.py
im['Exif.Photo.UserComment'] = comment
im.save_file()