Skip to content

Commit deaca0c

Browse files
committed
Extra tests & RELEASE.md
1 parent 92a913a commit deaca0c

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
__pycache__/
21
poetry.lock

RELEASE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Release type: patch
2+
3+
*bug*: handling edge cases where image is absolute, does not exist, or cannot be identified by Pillow.
319 KB
Loading

pelican/plugins/image_process/test_image_process.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
from pelican.plugins.image_process import (
1212
ExifTool,
13+
compute_paths,
1314
harvest_images_in_fragment,
1415
is_img_identifiable,
1516
process_image,
@@ -563,4 +564,10 @@ def test_is_img_identifiable():
563564

564565
assert not is_img_identifiable("image/that/does/not/exist.png")
565566

567+
assert not is_img_identifiable(TEST_DATA.joinpath("folded_puzzle.png"))
566568
assert not is_img_identifiable(TEST_DATA.joinpath("minimal.svg"))
569+
570+
img = {"src": "https://upload.wikimedia.org/wikipedia/commons/3/34/Exemple.png"}
571+
settings = get_settings(IMAGE_PROCESS_DIR="derivatives")
572+
path = compute_paths(img, settings, derivative="thumb")
573+
assert not is_img_identifiable(path.source)

0 commit comments

Comments
 (0)