Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a watermark image fails with exception #125

Open
freemarkus opened this issue Sep 27, 2024 · 0 comments
Open

Using a watermark image fails with exception #125

freemarkus opened this issue Sep 27, 2024 · 0 comments

Comments

@freemarkus
Copy link

I try to use a png image as watermark (by setting PHOTO_WATERMARK_TEXT = '' and PHOTO_WATERMARK_IMG = 'image.png' in pelicanconf.py). This results in an exception every time an image is processed.

[21:23:04] ERROR photos: 'float' object cannot be interpreted photos.py:1786
as an integer
WARNING photos: An exception occurred photos.py:1787
Traceback (most recent call last):
File
"/home/markus/.local/share/pipx/venvs/pelican
/lib/python3.12/site-packages/pelican/plugins
/photos/photos.py", line 1784, in
process_image_process_wrapper
return image.process()
^^^^^^^^^^^^^^^
File
"/home/markus/.local/share/pipx/venvs/pelican
/lib/python3.12/site-packages/pelican/plugins
/photos/photos.py", line 1148, in process
image = func(image, *operation_args,
**operation_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^
File
"/home/markus/.local/share/pipx/venvs/pelican
/lib/python3.12/site-packages/pelican/plugins
/photos/photos.py", line 1363, in
_operation_watermark
watermark_layer.paste(mark_image,
mark_position, mark_image)
File
"/home/markus/.local/share/pipx/venvs/pelican
/lib/python3.12/site-packages/PIL/Image.py",
line 1713, in paste
self.im.paste(im, box, mask.im)
TypeError: 'float' object cannot be
interpreted as an integer
ERROR photos: 'float' object cannot be interpreted photos.py:1786
as an integer

The version installed is 1.6.0.

At a first look, the assignment to mark_position in plugins/photos/photos.py lines 1355 to 1358 seems to be wrong as it consults text_size. The plugin seems to work as intended if they are commented out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant