Skip to main content

PicDate: Quick and Simple Date Marking for Photos

Project description

PicDate: Quick and Simple Date Marking for Photos

Description

Existing tools are not for me, so I make this. The format and style are almost fully controlled by users. The DateTimeOriginal, i.e., the date the photo was taken, is added if the exif information exists; otherwise, stat.ST_MTIME, the time of last modification, is used for those photo without exif information. Note that ST_MTIME is just close to but not the taken time. The image quality are different after processed due to Pillow tool.

Install

pip3 install git+https://github.com/aben20807/picdate.git

stable version:

pip3 install git+https://github.com/aben20807/picdate.git@v2.0.0

Usage

picdate -s 20221012/ -r

Screenshot

DSC_0005

Font

Performance

  • 360 photos (1.72 GB) -> 360 photos with dates (1.31 GB): 5.967s

Help

$ picdate -h
usage: picdate [-h] -s DIR [-d DIR] [-f] [-r] [--text_size N] [--text_color COLOR]
               [--text_anchor TEXT_ANCHOR] [--pos_x X] [--pos_y Y] [--fine_tune_aspect_ratio RATIO]
               [--stroke_width STROKE_WIDTH] [--stroke_color COLOR] [--quality QUALITY]
               [--format FORMAT] [--img_exts IMG_EXTS]

PicDate: Quick and Simple Date Marking for Photos

options:
  -h, --help            show this help message and exit
  -s DIR, --src DIR     input dir (required) (default: None)
  -d DIR, --dst DIR     output dir (default: ./picdate_result/)
  -f, --force           overwrite existing files (default: False)
  -r, --recursive       recursively process (default: False)
  --text_size N         text size ('N' mm) (default: 4.24)
  --text_color COLOR    text color (default: (255, 149, 21))
  --text_anchor TEXT_ANCHOR
                        text anchor (ref: https://pillow.readthedocs.io/en/stable/handbook/text-
                        anchors.html#text-anchors) (default: rb)
  --pos_x X             position for x-axis from 0 (left) to 1 (right) (default: 0.94)
  --pos_y Y             position for y-axis from 0 (top) to 1 (bottom) (default: 0.94)
  --fine_tune_aspect_ratio RATIO
                        expect aspect ratio for fine tune pos for cropping ('none' or 'M/N' (M<=N))
                        (default: 2/3)
  --stroke_width STROKE_WIDTH
                        stroke width for text (default: 1)
  --stroke_color COLOR  stroke color (default: (242, 97, 0))
  --quality QUALITY     jpg output quality (default: 95)
  --format FORMAT       date format (ref: https://docs.python.org/3/library/datetime.html#strftime-
                        and-strptime-format-codes) (default: `%y %-m %-d)
  --img_exts IMG_EXTS   support extensions for processed photos (case insensitive) (default:
                        jpg,jpeg,png,tiff)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

picdate-2.0.1.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

picdate-2.0.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file picdate-2.0.1.tar.gz.

File metadata

  • Download URL: picdate-2.0.1.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for picdate-2.0.1.tar.gz
Algorithm Hash digest
SHA256 29fc20d2aaf13e8d145758414bc1dd136331a7200f97fa180429a7e3f404ea06
MD5 6ce8526e6b92a7b676d5bacb30678d0a
BLAKE2b-256 90ff3639ca1768e86b4892fbcc280ac84ec34cbb6b676ea456b1d1bb6fbfef13

See more details on using hashes here.

Provenance

The following attestation bundles were made for picdate-2.0.1.tar.gz:

Publisher: publish-to-pypi.yml on aben20807/picdate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file picdate-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: picdate-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for picdate-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bc6a2f2331aee991496df7a6fe2841c08bf7d60255f7eea1cda20b895de598ce
MD5 00b78b18f25e75db27262ac7973c5100
BLAKE2b-256 0fc73ae24c87fc1a93ef26d3161be52d9141d14ed89066606e0ed880eed2b23c

See more details on using hashes here.

Provenance

The following attestation bundles were made for picdate-2.0.1-py3-none-any.whl:

Publisher: publish-to-pypi.yml on aben20807/picdate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page