Skip to content

Using a watermark image fails with exception #125

@freemarkus

Description

@freemarkus

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions