fotolab 0.31.15__py3-none-any.whl → 0.32.0__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
@@ -20,12 +20,11 @@ import logging
20
20
  import os
21
21
  import subprocess
22
22
  import sys
23
- from importlib import metadata
24
23
  from pathlib import Path
25
24
 
26
25
  from PIL import Image
27
26
 
28
- __version__ = metadata.version("fotolab")
27
+ __version__ = "0.31.15"
29
28
 
30
29
  log = logging.getLogger(__name__)
31
30
 
@@ -43,6 +43,16 @@ def build_subparser(subparsers) -> None:
43
43
  metavar="IMAGE_FILENAMES",
44
44
  )
45
45
 
46
+ auto_parser.add_argument(
47
+ "-t",
48
+ "--text",
49
+ dest="text",
50
+ help="set the watermark text (default: '%(default)s')",
51
+ type=str,
52
+ default="kianmeng.org",
53
+ metavar="WATERMARK_TEXT",
54
+ )
55
+
46
56
 
47
57
  def run(args: argparse.Namespace) -> None:
48
58
  """Run auto subcommand.
@@ -60,7 +70,7 @@ def run(args: argparse.Namespace) -> None:
60
70
  "radius": 1,
61
71
  "percent": 100,
62
72
  "threshold": 2,
63
- "text": "kianmeng.org",
73
+ "text": f"{args.text if args.text else 'kianmeng.org'}",
64
74
  "position": "bottom-left",
65
75
  "font_size": 12,
66
76
  "font_color": "white",
@@ -69,13 +79,18 @@ def run(args: argparse.Namespace) -> None:
69
79
  "padding": 15,
70
80
  "camera": False,
71
81
  "canvas": False,
72
- "lowercase": False,
82
+ "lowercase": True,
73
83
  "before_after": False,
74
84
  "alpha": 128,
75
85
  }
76
- combined_args = argparse.Namespace(**vars(args), **extra_args)
86
+
87
+ # resolve error: argparse.Namespace() got multiple values for keyword
88
+ # argument 'text'
89
+ merged_args = {**vars(args), **extra_args}
90
+ combined_args = argparse.Namespace(**merged_args)
77
91
  combined_args.overwrite = True
78
92
  combined_args.open = False
93
+
79
94
  log.debug(args)
80
95
  log.debug(combined_args)
81
96
 
@@ -110,7 +110,8 @@ def build_subparser(subparsers: argparse._SubParsersAction) -> None:
110
110
  type=int,
111
111
  default=2,
112
112
  help=(
113
- "set the outline width of the watermark text (default: '%(default)s')"
113
+ "set the outline width of the watermark text "
114
+ "(default: '%(default)s')"
114
115
  ),
115
116
  metavar="OUTLINE_WIDTH",
116
117
  )
@@ -122,7 +123,8 @@ def build_subparser(subparsers: argparse._SubParsersAction) -> None:
122
123
  type=str,
123
124
  default="black",
124
125
  help=(
125
- "set the outline color of the watermark text (default: '%(default)s')"
126
+ "set the outline color of the watermark text "
127
+ "(default: '%(default)s')"
126
128
  ),
127
129
  metavar="OUTLINE_COLOR",
128
130
  )
@@ -325,7 +327,7 @@ def prepare_text(args: argparse.Namespace, image: Image.Image) -> str:
325
327
  if args.lowercase:
326
328
  text = text.lower()
327
329
 
328
- return text
330
+ return text.replace("\\n", "\n")
329
331
 
330
332
 
331
333
  def calc_font_size(image: Image.Image, args: argparse.Namespace) -> int:
@@ -1,14 +1,14 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fotolab
3
- Version: 0.31.15
4
- Summary: A console program that manipulate images.
5
- Keywords: photography,photo
3
+ Version: 0.32.0
6
4
  Author-email: Kian-Meng Ang <kianmeng@cpan.org>
7
- Requires-Python: >=3.9
8
- Description-Content-Type: text/markdown
5
+ License-Expression: AGPL-3.0-or-later
6
+ Project-URL: Changelog, https://github.com/kianmeng/fotolab/blob/master/CHANGELOG.md
7
+ Project-URL: Issues, https://github.com/kianmeng/fotolab/issues
8
+ Project-URL: Source, https://github.com/kianmeng/fotolab
9
+ Keywords: photography,photo
9
10
  Classifier: Development Status :: 3 - Alpha
10
11
  Classifier: Environment :: Console
11
- Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
12
12
  Classifier: Programming Language :: Python :: 3 :: Only
13
13
  Classifier: Programming Language :: Python :: 3.9
14
14
  Classifier: Programming Language :: Python :: 3.10
@@ -16,11 +16,25 @@ Classifier: Programming Language :: Python :: 3.11
16
16
  Classifier: Programming Language :: Python :: 3.12
17
17
  Classifier: Programming Language :: Python :: 3.13
18
18
  Classifier: Programming Language :: Python
19
+ Requires-Python: >=3.9
20
+ Description-Content-Type: text/markdown
19
21
  License-File: LICENSE.md
20
22
  Requires-Dist: pillow
21
- Project-URL: Changelog, https://github.com/kianmeng/fotolab/blob/master/CHANGELOG.md
22
- Project-URL: Issues, https://github.com/kianmeng/fotolab/issues
23
- Project-URL: Source, https://github.com/kianmeng/fotolab
23
+ Provides-Extra: test
24
+ Requires-Dist: pytest; extra == "test"
25
+ Requires-Dist: pytest-cov; extra == "test"
26
+ Requires-Dist: pytest-randomly; extra == "test"
27
+ Requires-Dist: pytest-xdist; extra == "test"
28
+ Requires-Dist: scripttest; extra == "test"
29
+ Provides-Extra: doc
30
+ Requires-Dist: myst-parser; extra == "doc"
31
+ Requires-Dist: sphinx; extra == "doc"
32
+ Requires-Dist: sphinx-autodoc-typehints; extra == "doc"
33
+ Requires-Dist: sphinx-copybutton; extra == "doc"
34
+ Provides-Extra: lint
35
+ Requires-Dist: pre-commit; extra == "lint"
36
+ Requires-Dist: ruff; extra == "lint"
37
+ Dynamic: license-file
24
38
 
25
39
  # fotolab
26
40
 
@@ -471,4 +485,3 @@ The fish logo used in the documentation generated by Sphinx is a public domain
471
485
  drawing of male freshwater phase [Sockeye (red) salmon (Oncorhynchus nerka)]
472
486
  (https://en.wikipedia.org/w/index.php?oldid=1186575702) from
473
487
  <https://commons.wikimedia.org/entity/M2787002>.
474
-
@@ -1,9 +1,9 @@
1
- fotolab/__init__.py,sha256=7XrkZPbYLVCnsak061vye7L9hFC7zj7cP7XWdjunAk8,3137
1
+ fotolab/__init__.py,sha256=F1sYdgd88MdxeT60olYsMzaMY7EipL8lJlL44BuFYj4,3088
2
2
  fotolab/__main__.py,sha256=aboOURPs_snOXTEWYR0q8oq1UTY9e-NxCd1j33V0wHI,833
3
3
  fotolab/cli.py,sha256=oFiQXmsu3wIsM_DpZnL4B94sAoB62L16Am-cjxGmosY,4406
4
4
  fotolab/subcommands/__init__.py,sha256=l3DlIaJ3u3jGjnC1H1yV8LZ_nPqOLJ6gikD4BCaMAQ0,1129
5
5
  fotolab/subcommands/animate.py,sha256=t1F0ekbYWVlQcCtnwsW_gsWjkFdGDqcr4R8VUztUuzI,5481
6
- fotolab/subcommands/auto.py,sha256=3Hl1cCdu65GcfwvwiMRAcex6c7zA-KqIY6AFnB6nI3w,2447
6
+ fotolab/subcommands/auto.py,sha256=8QXSCd0BzvLiIKEGp8SUUq9XGIEoYZ9l6BueW0xQVUg,2849
7
7
  fotolab/subcommands/border.py,sha256=VYs8SorNYMwk7bVhD7jyolvFly7XdV-s9tNVQQYZPtA,4671
8
8
  fotolab/subcommands/contrast.py,sha256=fcXmHnxDw74j5ZUDQ5cwWh0N4tpyqqvEjymnpITgrEk,3027
9
9
  fotolab/subcommands/env.py,sha256=QoxRvzZKgmoHTUxDV4QYhdChCpMWs5TbXFY_qIpIQpE,1469
@@ -13,9 +13,10 @@ fotolab/subcommands/montage.py,sha256=ouwOnJQeXJTzsXi-4uby8c6k_VWg0Yo37FuvwAFx8M
13
13
  fotolab/subcommands/resize.py,sha256=eZGoHVMehpHrAX_y-M56s43lSvWmywMjHRVI_dYqpcA,5429
14
14
  fotolab/subcommands/rotate.py,sha256=uBFjHyjiBSQLtrtH1p9myODIHUDr1gkL4PpU-6Y1Ofo,2575
15
15
  fotolab/subcommands/sharpen.py,sha256=YNho2IPbc-lPvSy3Bsjehc2JOEy27LPqFSGRULs9MyY,3492
16
- fotolab/subcommands/watermark.py,sha256=cpdzmdzBXcaXWSrklYycnkPLjorLnTM-IXjPigPu0y0,11268
17
- fotolab-0.31.15.dist-info/entry_points.txt,sha256=mvw7AY_yZkIyjAxPtHNed9X99NZeLnMxEeAfEJUbrCM,44
18
- fotolab-0.31.15.dist-info/licenses/LICENSE.md,sha256=tGtFDwxWTjuR9syrJoSv1Hiffd2u8Tu8cYClfrXS_YU,31956
19
- fotolab-0.31.15.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
20
- fotolab-0.31.15.dist-info/METADATA,sha256=H03-P2JZnQ-3-DGimX2dyHsrmIrANSDuoYI403oL8pA,14307
21
- fotolab-0.31.15.dist-info/RECORD,,
16
+ fotolab/subcommands/watermark.py,sha256=xLejXelEae695DTN9T6fLbCu1YgIQIH-tFYQotJuCPI,11319
17
+ fotolab-0.32.0.dist-info/licenses/LICENSE.md,sha256=tGtFDwxWTjuR9syrJoSv1Hiffd2u8Tu8cYClfrXS_YU,31956
18
+ fotolab-0.32.0.dist-info/METADATA,sha256=PDhVkW_L-sLLojnhkbwRkpmT_hGq7C3ibinBUFXIEq8,14765
19
+ fotolab-0.32.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
20
+ fotolab-0.32.0.dist-info/entry_points.txt,sha256=0e1go9plFpqj5FP-OpV2acxTAx3ViI59PMXuhejvgcQ,45
21
+ fotolab-0.32.0.dist-info/top_level.txt,sha256=XUJ3gdpsbjohoZCLdVlbQrxAUDkbQg7WwGQG2DaN0t4,8
22
+ fotolab-0.32.0.dist-info/RECORD,,
@@ -1,4 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: flit 3.12.0
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ fotolab = fotolab.cli:main
@@ -0,0 +1 @@
1
+ fotolab
@@ -1,3 +0,0 @@
1
- [console_scripts]
2
- fotolab=fotolab.cli:main
3
-