PicDate: Quick and Simple Date Marking for Photos
Project description
PicDate: Quick and Simple Date Marking for Photos
Description
Photo studios no longer offer the service of adding dates to photos, so if you need it, you have to do it yourself. Since there didn't seem to be any tools for this, I created one. 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 qualities are different after processed due to Pillow tool.
Install
from PyPi:
pip3 install picdate
# or with specific version
pip3 install picdate==2.0.1
from GitHub:
pip3 install git+https://github.com/aben20807/picdate.git
# or with specific version
pip3 install git+https://github.com/aben20807/picdate.git@v2.0.1
Usage
picdate -s 20221012/ -r
After processing, a folder named picdate_result will be created, containing the processed files.
Screenshot
Font
- CursedTimerUlil-Aznm.ttf: designed by heaven castro and licensed as Freeware
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] [-j N] [--text_size N]
[--text_color COLOR] [--text_anchor TEXT_ANCHOR] [--pos_x X]
[--pos_y Y] [--fine_tune_aspect_ratio RATIO] [--stroke_width N]
[--stroke_color COLOR] [--quality N] [--resize W,H]
[--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)
-j N, --jobs N parallel jobs to process (default: 16)
--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 N stroke width for text (default: 1)
--stroke_color COLOR stroke color (default: (242, 97, 0))
--quality N jpg output quality (default: 95)
--resize W,H resize image to WxH (default: None)
--format FORMAT date format (ref: https://docs.python.org/3/library/date
time.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)
Known issues
strftimeexhibits different behavior across platforms, leading to invalid format strings. The current implementation detects the platform and applies a different default format: windows (`%y %#m %#d) and others (`%y %-m %-d).
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file picdate-2.1.0.tar.gz.
File metadata
- Download URL: picdate-2.1.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f425cb422b0235afa0a11251ee89ea27a9571d2ef95880f7d72ab678fc1f60de
|
|
| MD5 |
ce209e2b363853b616daaf45423d4734
|
|
| BLAKE2b-256 |
3eabc9b60f05ddb9b276d54c79e5041c3e4db9c8b04b6e108f116b1c45102fda
|
Provenance
The following attestation bundles were made for picdate-2.1.0.tar.gz:
Publisher:
publish-to-pypi.yml on aben20807/picdate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
picdate-2.1.0.tar.gz -
Subject digest:
f425cb422b0235afa0a11251ee89ea27a9571d2ef95880f7d72ab678fc1f60de - Sigstore transparency entry: 165819891
- Sigstore integration time:
-
Permalink:
aben20807/picdate@2127fe030fd0c19b83c1a1c54d44bf5c016db743 -
Branch / Tag:
refs/tags/v2.1.0 - Owner: https://github.com/aben20807
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@2127fe030fd0c19b83c1a1c54d44bf5c016db743 -
Trigger Event:
push
-
Statement type:
File details
Details for the file picdate-2.1.0-py3-none-any.whl.
File metadata
- Download URL: picdate-2.1.0-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66fbd96d82bcff6d33bf3c9289e3e0e1fc0bf582c645526583a9ca3c2acdc7d9
|
|
| MD5 |
6b796b28171df1611850d4b3e9ed3566
|
|
| BLAKE2b-256 |
be29c51b1a6cac928e7408e4d53c2c789ff884173349b41bb92cdaec52ff1fb5
|
Provenance
The following attestation bundles were made for picdate-2.1.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on aben20807/picdate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
picdate-2.1.0-py3-none-any.whl -
Subject digest:
66fbd96d82bcff6d33bf3c9289e3e0e1fc0bf582c645526583a9ca3c2acdc7d9 - Sigstore transparency entry: 165819893
- Sigstore integration time:
-
Permalink:
aben20807/picdate@2127fe030fd0c19b83c1a1c54d44bf5c016db743 -
Branch / Tag:
refs/tags/v2.1.0 - Owner: https://github.com/aben20807
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@2127fe030fd0c19b83c1a1c54d44bf5c016db743 -
Trigger Event:
push
-
Statement type: