fotolab 0.20.1__py2.py3-none-any.whl → 0.21.0__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
fotolab/__init__.py CHANGED
@@ -21,7 +21,7 @@ import subprocess
21
21
  import sys
22
22
  from pathlib import Path
23
23
 
24
- __version__ = "0.20.1"
24
+ __version__ = "0.21.0"
25
25
 
26
26
  log = logging.getLogger(__name__)
27
27
 
fotolab/info.py CHANGED
@@ -46,6 +46,14 @@ def build_subparser(subparsers) -> None:
46
46
  help="show image info by sorted field name",
47
47
  )
48
48
 
49
+ info_parser.add_argument(
50
+ "--camera",
51
+ default=False,
52
+ action="store_true",
53
+ dest="camera",
54
+ help="show the camera maker details",
55
+ )
56
+
49
57
 
50
58
  def run(args: argparse.Namespace) -> None:
51
59
  """Run info subcommand.
@@ -57,11 +65,13 @@ def run(args: argparse.Namespace) -> None:
57
65
  None
58
66
  """
59
67
  log.debug(args)
60
-
61
- exif_tags = extract_exif_tags(args.image.filename)
62
- tag_name_width = max(map(len, exif_tags))
63
- for tag_name, tag_value in exif_tags.items():
64
- print(f"{tag_name:<{tag_name_width}}: {tag_value}")
68
+ if args.camera:
69
+ print(camera_metadata(args.image_filename))
70
+ else:
71
+ exif_tags = extract_exif_tags(args.image_filename)
72
+ tag_name_width = max(map(len, exif_tags))
73
+ for tag_name, tag_value in exif_tags.items():
74
+ print(f"{tag_name:<{tag_name_width}}: {tag_value}")
65
75
 
66
76
 
67
77
  def extract_exif_tags(image_filename: str, sort: bool = False) -> dict:
@@ -77,3 +87,10 @@ def extract_exif_tags(image_filename: str, sort: bool = False) -> dict:
77
87
  filtered_info = dict(sorted(filtered_info.items()))
78
88
 
79
89
  return filtered_info
90
+
91
+
92
+ def camera_metadata(image_filename):
93
+ """Extract camera and model metadata."""
94
+ exif_tags = extract_exif_tags(image_filename)
95
+ metadata = f'{exif_tags["Make"]} {exif_tags["Model"]}'
96
+ return metadata.strip()
fotolab/watermark.py CHANGED
@@ -244,6 +244,8 @@ def calc_padding(image, args) -> int:
244
244
 
245
245
  def calc_position(image, text_width, text_height, position, padding) -> tuple:
246
246
  """Calculate the boundary coordinates of the watermark text."""
247
+ (position_x, position_y) = (0, 0)
248
+
247
249
  if position == "top-left":
248
250
  position_x = 0 + padding
249
251
  position_y = 0 + padding
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fotolab
3
- Version: 0.20.1
3
+ Version: 0.21.0
4
4
  Summary: A console program that manipulate images.
5
5
  Keywords: photography,photo
6
6
  Author-email: Kian-Meng Ang <kianmeng@cpan.org>
@@ -9,11 +9,11 @@ Classifier: Development Status :: 3 - Alpha
9
9
  Classifier: Environment :: Console
10
10
  Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
11
11
  Classifier: Programming Language :: Python :: 3 :: Only
12
- Classifier: Programming Language :: Python :: 3.8
13
12
  Classifier: Programming Language :: Python :: 3.9
14
13
  Classifier: Programming Language :: Python :: 3.10
15
14
  Classifier: Programming Language :: Python :: 3.11
16
15
  Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
17
  Classifier: Programming Language :: Python
18
18
  Requires-Dist: pillow
19
19
  Project-URL: Changelog, https://github.com/kianmeng/fotolab/blob/master/CHANGELOG.md
@@ -1,4 +1,4 @@
1
- fotolab/__init__.py,sha256=kFjveIbYfTI8In7w4thI9J-nbyQVC61T8YF6KxxAJ3c,2061
1
+ fotolab/__init__.py,sha256=1XF9Lprg2Pk9MDISiqVACsaGeJztySkwXJ6-JaO81xA,2061
2
2
  fotolab/__main__.py,sha256=aboOURPs_snOXTEWYR0q8oq1UTY9e-NxCd1j33V0wHI,833
3
3
  fotolab/animate.py,sha256=ejimhTozo9DN7BbqqcV4x8zLnanZRKq1pxBBFeOdr6Q,2967
4
4
  fotolab/auto.py,sha256=l_-Kf5V5Anvwz1QV1ET-42YsDWEeHf_okHkXWOycWAI,2295
@@ -6,14 +6,14 @@ fotolab/border.py,sha256=5ch2d7LVPhB2OFuuXSW5ci6Cn967CPDQu0qSfaO7uMg,3591
6
6
  fotolab/cli.py,sha256=FBFSeMNqcOiJ6MuAcy0qUvc9cscdFUG946HlWZXBPtY,4984
7
7
  fotolab/contrast.py,sha256=l7Bs5p8W8ypN9Cg3fFHnU-A20UwMKtjTiPk6D0PRwpM,2095
8
8
  fotolab/env.py,sha256=fzUoRWgYEiYJIWYEiiSLEb7dH_xVUOnhMpQgc1yjrTY,1457
9
- fotolab/info.py,sha256=kbKMIqdkK-Wn2lWLvnFL_Efc45K9KCaR_euTv9LIGzw,2256
9
+ fotolab/info.py,sha256=FgLST4yxl4tX3Lag1PfJTz31kzVTE0SWFbHAJS4hTYI,2752
10
10
  fotolab/montage.py,sha256=lUVY-zDSH7mwH-s34_XefdNp7CoDJHkwpbTUGiyJGgs,2037
11
11
  fotolab/resize.py,sha256=2bH1Kgoe_DqU8ozJ1E_oA6a9JPtuwIlo5a4sq_4Yles,5018
12
12
  fotolab/rotate.py,sha256=l_vQgf0IcI8AR1TSVsk4PrMZtJ3j_wpU77rKiGJ-KTA,1715
13
13
  fotolab/sharpen.py,sha256=wUPtJdtB6mCRmcHrA0CoEVO0O0ROBJWhejTvUeL67QU,2655
14
- fotolab/watermark.py,sha256=zxmTT1k78tdqqzbRu13YVOFQ0Z1cKd7JHU4M0nV01DU,7418
15
- fotolab-0.20.1.dist-info/entry_points.txt,sha256=mvw7AY_yZkIyjAxPtHNed9X99NZeLnMxEeAfEJUbrCM,44
16
- fotolab-0.20.1.dist-info/LICENSE.md,sha256=tGtFDwxWTjuR9syrJoSv1Hiffd2u8Tu8cYClfrXS_YU,31956
17
- fotolab-0.20.1.dist-info/WHEEL,sha256=Sgu64hAMa6g5FdzHxXv9Xdse9yxpGGMeagVtPMWpJQY,99
18
- fotolab-0.20.1.dist-info/METADATA,sha256=GhF0LxtDve3dgZbjoKLf89Z4D-dPZQMUoXfSTwEoWiI,10576
19
- fotolab-0.20.1.dist-info/RECORD,,
14
+ fotolab/watermark.py,sha256=-YzxABVT5KJM1GgYLP3Z8X9YPfQzncOA9YnRJgNN6nA,7457
15
+ fotolab-0.21.0.dist-info/entry_points.txt,sha256=mvw7AY_yZkIyjAxPtHNed9X99NZeLnMxEeAfEJUbrCM,44
16
+ fotolab-0.21.0.dist-info/LICENSE.md,sha256=tGtFDwxWTjuR9syrJoSv1Hiffd2u8Tu8cYClfrXS_YU,31956
17
+ fotolab-0.21.0.dist-info/WHEEL,sha256=Sgu64hAMa6g5FdzHxXv9Xdse9yxpGGMeagVtPMWpJQY,99
18
+ fotolab-0.21.0.dist-info/METADATA,sha256=NOPnTOeLUB51nhb-IekFBUOrWgTGZlA5VUPyBEvJr8s,10577
19
+ fotolab-0.21.0.dist-info/RECORD,,