fotolab 0.19.0__tar.gz → 0.20.0__tar.gz
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-0.19.0 → fotolab-0.20.0}/CHANGELOG.md +6 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/PKG-INFO +10 -7
- {fotolab-0.19.0 → fotolab-0.20.0}/README.md +9 -6
- {fotolab-0.19.0 → fotolab-0.20.0}/fotolab/__init__.py +1 -1
- {fotolab-0.19.0 → fotolab-0.20.0}/fotolab/resize.py +17 -2
- {fotolab-0.19.0 → fotolab-0.20.0}/.coveragerc +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/.gitignore +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/.pre-commit-config.yaml +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/.python-version +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/CONTRIBUTING.md +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/LICENSE.md +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/Pipfile +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/Pipfile.lock +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/docs/Makefile +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/docs/make.bat +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/docs/source/CHANGELOG.md +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/docs/source/CONTRIBUTING.md +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/docs/source/LICENSE.md +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/docs/source/README.md +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/docs/source/_static/logo.jpg +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/docs/source/conf.py +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/docs/source/index.rst +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/fotolab/__main__.py +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/fotolab/animate.py +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/fotolab/auto.py +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/fotolab/border.py +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/fotolab/cli.py +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/fotolab/contrast.py +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/fotolab/env.py +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/fotolab/info.py +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/fotolab/montage.py +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/fotolab/rotate.py +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/fotolab/sharpen.py +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/fotolab/watermark.py +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/noxfile.py +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/pyproject.toml +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/tests/__init__.py +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/tests/conftest.py +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/tests/test_env.py +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/tests/test_help_flag.py +0 -0
- {fotolab-0.19.0 → fotolab-0.20.0}/tests/test_quiet_flag.py +0 -0
@@ -7,6 +7,12 @@ and this project adheres to [0-based versioning](https://0ver.org/).
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## v0.20.0 (2024-11-10)
|
11
|
+
|
12
|
+
- Add `-l` or `--canvas-color` option to set color to extended canvas
|
13
|
+
- Bump deps
|
14
|
+
- Update help message in readme
|
15
|
+
|
10
16
|
## v0.19.0 (2024-11-03)
|
11
17
|
|
12
18
|
- Add `-c` or `--canvas` flag to paste an image onto larger canvas
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: fotolab
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.20.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>
|
@@ -266,17 +266,20 @@ fotolab resize -h
|
|
266
266
|
<!--help-resize !-->
|
267
267
|
|
268
268
|
```console
|
269
|
-
usage: fotolab resize [-h] [-c] [-W WIDTH | -H HEIGHT]
|
269
|
+
usage: fotolab resize [-h] [-c] [-l CANVAS_COLOR] [-W WIDTH | -H HEIGHT]
|
270
270
|
IMAGE_FILENAMES [IMAGE_FILENAMES ...]
|
271
271
|
|
272
272
|
positional arguments:
|
273
|
-
IMAGE_FILENAMES
|
273
|
+
IMAGE_FILENAMES set the image filename
|
274
274
|
|
275
275
|
options:
|
276
|
-
-h, --help
|
277
|
-
-c, --canvas
|
278
|
-
-
|
279
|
-
|
276
|
+
-h, --help show this help message and exit
|
277
|
+
-c, --canvas paste image onto a larger canvas
|
278
|
+
-l, --canvas-color CANVAS_COLOR
|
279
|
+
the color of the extended larger canvas(default:
|
280
|
+
'black')
|
281
|
+
-W, --width WIDTH set the width of the image (default: '600')
|
282
|
+
-H, --height HEIGHT set the height of the image (default: '277')
|
280
283
|
```
|
281
284
|
|
282
285
|
<!--help-resize !-->
|
@@ -244,17 +244,20 @@ fotolab resize -h
|
|
244
244
|
<!--help-resize !-->
|
245
245
|
|
246
246
|
```console
|
247
|
-
usage: fotolab resize [-h] [-c] [-W WIDTH | -H HEIGHT]
|
247
|
+
usage: fotolab resize [-h] [-c] [-l CANVAS_COLOR] [-W WIDTH | -H HEIGHT]
|
248
248
|
IMAGE_FILENAMES [IMAGE_FILENAMES ...]
|
249
249
|
|
250
250
|
positional arguments:
|
251
|
-
IMAGE_FILENAMES
|
251
|
+
IMAGE_FILENAMES set the image filename
|
252
252
|
|
253
253
|
options:
|
254
|
-
-h, --help
|
255
|
-
-c, --canvas
|
256
|
-
-
|
257
|
-
|
254
|
+
-h, --help show this help message and exit
|
255
|
+
-c, --canvas paste image onto a larger canvas
|
256
|
+
-l, --canvas-color CANVAS_COLOR
|
257
|
+
the color of the extended larger canvas(default:
|
258
|
+
'black')
|
259
|
+
-W, --width WIDTH set the width of the image (default: '600')
|
260
|
+
-H, --height HEIGHT set the height of the image (default: '277')
|
258
261
|
```
|
259
262
|
|
260
263
|
<!--help-resize !-->
|
@@ -20,7 +20,7 @@ import logging
|
|
20
20
|
import math
|
21
21
|
import sys
|
22
22
|
|
23
|
-
from PIL import Image
|
23
|
+
from PIL import Image, ImageColor
|
24
24
|
|
25
25
|
from fotolab import save_image
|
26
26
|
|
@@ -54,6 +54,17 @@ def build_subparser(subparsers) -> None:
|
|
54
54
|
help="paste image onto a larger canvas",
|
55
55
|
)
|
56
56
|
|
57
|
+
resize_parser.add_argument(
|
58
|
+
"-l",
|
59
|
+
"--canvas-color",
|
60
|
+
default="black",
|
61
|
+
dest="canvas_color",
|
62
|
+
help=(
|
63
|
+
"the color of the extended larger canvas"
|
64
|
+
"(default: '%(default)s')"
|
65
|
+
),
|
66
|
+
)
|
67
|
+
|
57
68
|
if "-c" in sys.argv or "--canvas" in sys.argv:
|
58
69
|
resize_parser.add_argument(
|
59
70
|
"-W",
|
@@ -119,7 +130,11 @@ def run(args: argparse.Namespace) -> None:
|
|
119
130
|
|
120
131
|
|
121
132
|
def _resize_image_onto_canvas(original_image, args):
|
122
|
-
resized_image = Image.new(
|
133
|
+
resized_image = Image.new(
|
134
|
+
"RGB",
|
135
|
+
(args.width, args.height),
|
136
|
+
(*ImageColor.getrgb(args.canvas_color), 128),
|
137
|
+
)
|
123
138
|
x_offset = (args.width - original_image.width) // 2
|
124
139
|
y_offset = (args.height - original_image.height) // 2
|
125
140
|
resized_image.paste(original_image, (x_offset, y_offset))
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|