Roland's homepage

My random knot in the Web

markphotos

The markphotos.py script adds a copyright notice to JPEG pictures as metadata.

Update: use the platform-neutral os.devnull instead of the /dev/null device that is generally only found on UNIX-like platforms.

It uses exiftool. This is not a visible notice, but one contained in the file’s metadata. The following in an excerpt from the identify --verbose output of a photos that was marked by markphotos.py:

Image: img_0541.jpg
  Format: JPEG (Joint Photographic Experts Group JFIF format)
  Class: DirectClass
  Geometry: 3648x2736+0+0
  Resolution: 180x180
  Print size: 20.2667x15.2
  Units: PixelsPerInch
  Type: TrueColor
  ...
  Properties:
     comment: Copyright © 2011 R.F. Smith <rsmith@xs4all.nl>
     ...
     exif:DateTime: 2011:06:08 21:53:32

To speed up the processing of multiple pictures, this script runs in parallel on all the cores that your machine has. If you want to add a visual watermark to a picture, I suggest using the mogrify program from the ImageMagick suite.

Note

Edit the script and change the string cr in the function processfile to something appropriate before using this script!

Source:markphotos.py
GPG signature:
——-BEGIN PGP SIGNATURE——-
Version: GnuPG v2

iQIcBAABCAAGBQJUlIorAAoJEED21dyjijPgmMQP/0NPVUjgZo2S+JNqJ117z/nd
lkN6NDg4HmXsUXK6y5mTjpm3IzwU/i0iI92O5iSHCsmxTN0C8HurHW14Lfvd9IDe
+kP3uNvSpdk6uo7S8+N1ZkRbz2RAzU5ty+YWFJb7xRPKksK0Qqg+s3tCG5hqOWNS
fwPxEwSZdP4h3DfgL0KDRTLW9KLaN39U9UQyZ6yjYi4wYSfdFR1tp7k5jjqE9IFX
VkCbNCEBrQA8eP/1RI0du5b4okhsavOcO5wQaKxbGeIcNnPenols4JUlwIUBE+qq
T5pmpARrxHLO/uu/4G/ZNojbD+69IeJtAUpll9kvTPNV4BGeaz0maGi6jhndOhau
SEZmCFrNqDl1btl0Tkn/vaIBisVglW5CxAvXjCot7pU1J+4BN0pt4aKq8wW7J7Z1
2gAOKDRUbpD1mfwMbLJAT00q4LgMYXxIBQYrTmMLvmLmFzcR3GNj2gUX5+L9LpyQ
SdCLGRPRJUWqjb898R20fhOhdk9NjuAm7+MJTLqc8BuNykxLvyWcGEdIJjy7O2TE
nQBCxRXZahnp+ULBTxu++pG/d6G8CcZYwdcX1m8dNc0+RbUMBJdvbcNCBQutnElp
rxx9TIrPFpT6O7hU4pV+jrZ/TBSlEhN+CMIqNwGWrvzhXQKvGYyNivSXy7A9P5/e
Teb6QxGTRn7ZtY4mItdH
=AZOP
——-END PGP SIGNATURE——-
SHA256 hash:c589811a27b7422898ce10c666d9477798d41abc41e1ab30ec268924669e80b8
Requirements:python (version 3), exiftool

Note

The script is now compatible with both Python 2 and Python 3. But it uses the latter by default. Change the first line of the script if you want to use Python 2. In that case you should also add the following line to the script:

from __future__ import print_function

Note

creative commons public domain logo

To the extent possible under law, Roland Smith has waived all copyright and related or neighboring rights to markphotos.py. This work is published from the Netherlands.


←  tifftopdf make-flac  →