fotolab 0.27.0__tar.gz → 0.27.1__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.0 → fotolab-0.27.1}/.pre-commit-config.yaml +1 -1
- {fotolab-0.27.0 → fotolab-0.27.1}/CHANGELOG.md +8 -0
- {fotolab-0.27.0 → fotolab-0.27.1}/PKG-INFO +1 -1
- {fotolab-0.27.0 → fotolab-0.27.1}/fotolab/__init__.py +2 -1
- {fotolab-0.27.0 → fotolab-0.27.1}/fotolab/cli.py +1 -1
- {fotolab-0.27.0 → fotolab-0.27.1}/fotolab/subcommands/animate.py +1 -1
- {fotolab-0.27.0 → fotolab-0.27.1}/fotolab/subcommands/auto.py +1 -1
- {fotolab-0.27.0 → fotolab-0.27.1}/fotolab/subcommands/border.py +1 -1
- {fotolab-0.27.0 → fotolab-0.27.1}/fotolab/subcommands/contrast.py +1 -1
- {fotolab-0.27.0 → fotolab-0.27.1}/fotolab/subcommands/env.py +1 -1
- {fotolab-0.27.0 → fotolab-0.27.1}/fotolab/subcommands/halftone.py +1 -1
- {fotolab-0.27.0 → fotolab-0.27.1}/fotolab/subcommands/info.py +1 -1
- {fotolab-0.27.0 → fotolab-0.27.1}/fotolab/subcommands/montage.py +1 -1
- {fotolab-0.27.0 → fotolab-0.27.1}/fotolab/subcommands/rotate.py +1 -1
- {fotolab-0.27.0 → fotolab-0.27.1}/fotolab/subcommands/sharpen.py +1 -1
- {fotolab-0.27.0 → fotolab-0.27.1}/fotolab/subcommands/watermark.py +22 -4
- {fotolab-0.27.0 → fotolab-0.27.1}/noxfile.py +1 -1
- {fotolab-0.27.0 → fotolab-0.27.1}/.coveragerc +0 -0
- {fotolab-0.27.0 → fotolab-0.27.1}/.gitignore +0 -0
- {fotolab-0.27.0 → fotolab-0.27.1}/.python-version +0 -0
- {fotolab-0.27.0 → fotolab-0.27.1}/CONTRIBUTING.md +0 -0
- {fotolab-0.27.0 → fotolab-0.27.1}/LICENSE.md +0 -0
- {fotolab-0.27.0 → fotolab-0.27.1}/Pipfile +0 -0
- {fotolab-0.27.0 → fotolab-0.27.1}/Pipfile.lock +0 -0
- {fotolab-0.27.0 → fotolab-0.27.1}/README.md +0 -0
- {fotolab-0.27.0 → fotolab-0.27.1}/docs/Makefile +0 -0
- {fotolab-0.27.0 → fotolab-0.27.1}/docs/make.bat +0 -0
- {fotolab-0.27.0 → fotolab-0.27.1}/docs/source/CHANGELOG.md +0 -0
- {fotolab-0.27.0 → fotolab-0.27.1}/docs/source/CONTRIBUTING.md +0 -0
- {fotolab-0.27.0 → fotolab-0.27.1}/docs/source/LICENSE.md +0 -0
- {fotolab-0.27.0 → fotolab-0.27.1}/docs/source/README.md +0 -0
- {fotolab-0.27.0 → fotolab-0.27.1}/docs/source/_static/logo.jpg +0 -0
- {fotolab-0.27.0 → fotolab-0.27.1}/docs/source/conf.py +0 -0
- {fotolab-0.27.0 → fotolab-0.27.1}/docs/source/index.rst +0 -0
- {fotolab-0.27.0 → fotolab-0.27.1}/fotolab/__main__.py +0 -0
- {fotolab-0.27.0 → fotolab-0.27.1}/fotolab/subcommands/__init__.py +0 -0
- {fotolab-0.27.0 → fotolab-0.27.1}/fotolab/subcommands/resize.py +0 -0
- {fotolab-0.27.0 → fotolab-0.27.1}/pyproject.toml +0 -0
- {fotolab-0.27.0 → fotolab-0.27.1}/tests/__init__.py +0 -0
- {fotolab-0.27.0 → fotolab-0.27.1}/tests/conftest.py +0 -0
- {fotolab-0.27.0 → fotolab-0.27.1}/tests/test_env_subcommand.py +0 -0
- {fotolab-0.27.0 → fotolab-0.27.1}/tests/test_help_flag.py +0 -0
- {fotolab-0.27.0 → fotolab-0.27.1}/tests/test_quiet_flag.py +0 -0
@@ -7,6 +7,14 @@ and this project adheres to [0-based versioning](https://0ver.org/).
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## v0.27.1 (2025-02-23)
|
11
|
+
|
12
|
+
- Bump pre-commit hooks
|
13
|
+
- Fix incorrect arg type in comment in all subcommands
|
14
|
+
- Fix missing type from comment
|
15
|
+
- Fix saving watermark image only by hardcoded name
|
16
|
+
- Fix typos in license header
|
17
|
+
|
10
18
|
## v0.27.0 (2025-02-16)
|
11
19
|
|
12
20
|
- Explicitly name the attribute for the subcommand
|
@@ -20,7 +20,7 @@ import subprocess
|
|
20
20
|
import sys
|
21
21
|
from pathlib import Path
|
22
22
|
|
23
|
-
__version__ = "0.27.
|
23
|
+
__version__ = "0.27.1"
|
24
24
|
|
25
25
|
log = logging.getLogger(__name__)
|
26
26
|
|
@@ -31,6 +31,7 @@ def save_image(args, new_image, output_filename, subcommand):
|
|
31
31
|
Args:
|
32
32
|
args (argparse.Namespace): Config from command line arguments
|
33
33
|
new_image(PIL.Image.Image): Modified image
|
34
|
+
output_filename(str): Save filename image
|
34
35
|
subcommand(str): Subcommand used to call this function
|
35
36
|
|
36
37
|
Returns:
|
@@ -8,7 +8,7 @@
|
|
8
8
|
# This program is distributed in the hope that it will be useful,
|
9
9
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
10
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
11
|
-
# GNU
|
11
|
+
# GNU General Public License for more details.
|
12
12
|
|
13
13
|
# You should have received a copy of the GNU General Public License
|
14
14
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
@@ -18,10 +18,11 @@
|
|
18
18
|
import argparse
|
19
19
|
import logging
|
20
20
|
import math
|
21
|
+
from pathlib import Path
|
21
22
|
|
22
23
|
from PIL import Image, ImageColor, ImageDraw, ImageFont, ImageSequence
|
23
24
|
|
24
|
-
from fotolab import save_image
|
25
|
+
from fotolab import _open_image, save_image
|
25
26
|
from fotolab.subcommands.info import camera_metadata
|
26
27
|
|
27
28
|
log = logging.getLogger(__name__)
|
@@ -159,21 +160,36 @@ def run(args: argparse.Namespace) -> None:
|
|
159
160
|
for image_filename in args.image_filenames:
|
160
161
|
image = Image.open(image_filename)
|
161
162
|
if image.format == "GIF":
|
162
|
-
watermark_gif_image(image, args)
|
163
|
+
watermark_gif_image(image, image_filename, args)
|
163
164
|
else:
|
164
165
|
watermarked_image = watermark_non_gif_image(image, args)
|
165
166
|
save_image(args, watermarked_image, image_filename, "watermark")
|
166
167
|
|
167
168
|
|
168
|
-
def watermark_gif_image(
|
169
|
+
def watermark_gif_image(
|
170
|
+
original_image: Image.Image, output_filename: str, args: argparse.Namespace
|
171
|
+
) -> None:
|
169
172
|
"""Watermark the image."""
|
170
173
|
frames = []
|
171
174
|
for frame in ImageSequence.Iterator(original_image):
|
172
175
|
watermarked_frame = watermark_image(args, frame.convert("RGBA"))
|
173
176
|
frames.append(watermarked_frame)
|
174
177
|
|
178
|
+
image_file = Path(output_filename)
|
179
|
+
|
180
|
+
if args.overwrite:
|
181
|
+
new_filename = original_image.with_name(image_file.name)
|
182
|
+
else:
|
183
|
+
new_filename = Path(
|
184
|
+
args.output_dir,
|
185
|
+
image_file.with_name(f"watermark_{image_file.name}"),
|
186
|
+
)
|
187
|
+
new_filename.parent.mkdir(parents=True, exist_ok=True)
|
188
|
+
|
189
|
+
log.info("%s image: %s", "watermark", new_filename.resolve())
|
190
|
+
|
175
191
|
frames[0].save(
|
176
|
-
|
192
|
+
new_filename,
|
177
193
|
format="GIF",
|
178
194
|
append_images=frames[1:],
|
179
195
|
save_all=True,
|
@@ -181,6 +197,8 @@ def watermark_gif_image(original_image: Image.Image, args: argparse.Namespace):
|
|
181
197
|
loop=original_image.info.get("loop", 0),
|
182
198
|
disposal=original_image.info.get("disposal", 2),
|
183
199
|
)
|
200
|
+
if args.open:
|
201
|
+
_open_image(new_filename)
|
184
202
|
|
185
203
|
|
186
204
|
def watermark_non_gif_image(
|
@@ -8,7 +8,7 @@
|
|
8
8
|
# This program is distributed in the hope that it will be useful,
|
9
9
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
10
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
11
|
-
# GNU
|
11
|
+
# GNU General Public License for more details.
|
12
12
|
|
13
13
|
# You should have received a copy of the GNU General Public License
|
14
14
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
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
|