fotolab 0.27.1__tar.gz → 0.27.2__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.27.1 → fotolab-0.27.2}/.pre-commit-config.yaml +1 -1
- {fotolab-0.27.1 → fotolab-0.27.2}/CHANGELOG.md +9 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/PKG-INFO +1 -1
- {fotolab-0.27.1 → fotolab-0.27.2}/fotolab/__init__.py +1 -1
- {fotolab-0.27.1 → fotolab-0.27.2}/fotolab/cli.py +9 -8
- {fotolab-0.27.1 → fotolab-0.27.2}/fotolab/subcommands/sharpen.py +6 -1
- {fotolab-0.27.1 → fotolab-0.27.2}/fotolab/subcommands/watermark.py +22 -8
- {fotolab-0.27.1 → fotolab-0.27.2}/noxfile.py +1 -1
- {fotolab-0.27.1 → fotolab-0.27.2}/.coveragerc +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/.gitignore +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/.python-version +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/CONTRIBUTING.md +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/LICENSE.md +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/Pipfile +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/Pipfile.lock +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/README.md +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/docs/Makefile +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/docs/make.bat +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/docs/source/CHANGELOG.md +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/docs/source/CONTRIBUTING.md +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/docs/source/LICENSE.md +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/docs/source/README.md +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/docs/source/_static/logo.jpg +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/docs/source/conf.py +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/docs/source/index.rst +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/fotolab/__main__.py +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/fotolab/subcommands/__init__.py +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/fotolab/subcommands/animate.py +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/fotolab/subcommands/auto.py +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/fotolab/subcommands/border.py +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/fotolab/subcommands/contrast.py +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/fotolab/subcommands/env.py +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/fotolab/subcommands/halftone.py +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/fotolab/subcommands/info.py +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/fotolab/subcommands/montage.py +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/fotolab/subcommands/resize.py +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/fotolab/subcommands/rotate.py +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/pyproject.toml +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/tests/__init__.py +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/tests/conftest.py +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/tests/test_env_subcommand.py +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/tests/test_help_flag.py +0 -0
- {fotolab-0.27.1 → fotolab-0.27.2}/tests/test_quiet_flag.py +0 -0
@@ -7,6 +7,15 @@ and this project adheres to [0-based versioning](https://0ver.org/).
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## v0.27.2 (2025-03-02)
|
11
|
+
|
12
|
+
- Add missing latest copyright year
|
13
|
+
- Add missing typehints
|
14
|
+
- Bump pre-commit hook for isort
|
15
|
+
- Fix cannot save watermarked gif image
|
16
|
+
- Refactor main logic
|
17
|
+
- Update docstring to `watermark_gif_image` function
|
18
|
+
|
10
19
|
## v0.27.1 (2025-02-23)
|
11
20
|
|
12
21
|
- Bump pre-commit hooks
|
@@ -147,15 +147,16 @@ def main(args: Optional[Sequence[str]] = None) -> None:
|
|
147
147
|
parser = build_parser()
|
148
148
|
if len(args) == 0:
|
149
149
|
parser.print_help(sys.stderr)
|
150
|
+
return
|
151
|
+
|
152
|
+
parsed_args = parser.parse_args(args)
|
153
|
+
setup_logging(parsed_args)
|
154
|
+
|
155
|
+
if hasattr(parsed_args, "func"):
|
156
|
+
log.debug(parsed_args)
|
157
|
+
parsed_args.func(parsed_args)
|
150
158
|
else:
|
151
|
-
|
152
|
-
setup_logging(parsed_args)
|
153
|
-
|
154
|
-
if hasattr(parsed_args, "func"):
|
155
|
-
log.debug(parsed_args)
|
156
|
-
parsed_args.func(parsed_args)
|
157
|
-
else:
|
158
|
-
parser.print_help(sys.stderr)
|
159
|
+
parser.print_help(sys.stderr)
|
159
160
|
|
160
161
|
except Exception as error:
|
161
162
|
log.error(
|
@@ -111,7 +111,12 @@ def run(args: argparse.Namespace) -> None:
|
|
111
111
|
save_image(args, sharpen_image, image_filename, "sharpen")
|
112
112
|
|
113
113
|
|
114
|
-
def save_gif_image(
|
114
|
+
def save_gif_image(
|
115
|
+
args: argparse.Namespace,
|
116
|
+
image_filename: str,
|
117
|
+
original_image: Image.Image,
|
118
|
+
sharpen_image: Image.Image,
|
119
|
+
) -> None:
|
115
120
|
"""Save the original and sharpen image."""
|
116
121
|
image_file = Path(image_filename)
|
117
122
|
new_filename = Path(
|
@@ -22,7 +22,7 @@ from pathlib import Path
|
|
22
22
|
|
23
23
|
from PIL import Image, ImageColor, ImageDraw, ImageFont, ImageSequence
|
24
24
|
|
25
|
-
from fotolab import
|
25
|
+
from fotolab import save_image
|
26
26
|
from fotolab.subcommands.info import camera_metadata
|
27
27
|
|
28
28
|
log = logging.getLogger(__name__)
|
@@ -169,7 +169,16 @@ def run(args: argparse.Namespace) -> None:
|
|
169
169
|
def watermark_gif_image(
|
170
170
|
original_image: Image.Image, output_filename: str, args: argparse.Namespace
|
171
171
|
) -> None:
|
172
|
-
"""Watermark
|
172
|
+
"""Watermark a GIF image.
|
173
|
+
|
174
|
+
Args:
|
175
|
+
original_image (Image.Image): The original GIF image
|
176
|
+
output_filename (str): Path to save the watermarked GIF
|
177
|
+
args (argparse.Namespace): Command line arguments
|
178
|
+
|
179
|
+
Returns:
|
180
|
+
None
|
181
|
+
"""
|
173
182
|
frames = []
|
174
183
|
for frame in ImageSequence.Iterator(original_image):
|
175
184
|
watermarked_frame = watermark_image(args, frame.convert("RGBA"))
|
@@ -190,21 +199,26 @@ def watermark_gif_image(
|
|
190
199
|
|
191
200
|
frames[0].save(
|
192
201
|
new_filename,
|
193
|
-
format="GIF",
|
194
|
-
append_images=frames[1:],
|
195
202
|
save_all=True,
|
203
|
+
append_images=frames[1:],
|
196
204
|
duration=original_image.info.get("duration", 100),
|
197
205
|
loop=original_image.info.get("loop", 0),
|
198
206
|
disposal=original_image.info.get("disposal", 2),
|
199
207
|
)
|
200
|
-
if args.open:
|
201
|
-
_open_image(new_filename)
|
202
208
|
|
203
209
|
|
204
210
|
def watermark_non_gif_image(
|
205
211
|
original_image: Image.Image, args: argparse.Namespace
|
206
|
-
):
|
207
|
-
"""Watermark
|
212
|
+
) -> Image.Image:
|
213
|
+
"""Watermark a non-GIF image.
|
214
|
+
|
215
|
+
Args:
|
216
|
+
original_image (Image.Image): The original image
|
217
|
+
args (argparse.Namespace): Command line arguments
|
218
|
+
|
219
|
+
Returns:
|
220
|
+
Image.Image: The watermarked image
|
221
|
+
"""
|
208
222
|
return watermark_image(args, original_image)
|
209
223
|
|
210
224
|
|
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
|