Skip to content

Commit a061035

Browse files
committed
Fix issue with CMYK images
Previously, if a CMYK cover image were encountered, the update would fail because the color space was not being handled correctly.
1 parent c476766 commit a061035

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/audio_feeder/updater.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,9 @@ def _generate_thumbnail(img_loc: PathType, thumb_loc: PathType) -> None:
874874
# Don't upscale it
875875
scale = min([scale, 1])
876876

877+
if img.mode != "RGB":
878+
img = img.convert("RGB")
879+
877880
img.thumbnail((w * scale, h * scale))
878881
img.save(thumb_loc)
879882

tests/test_updater.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ def patch_book_updater() -> typing.Iterator[None]:
9696
updater.BookDatabaseUpdater = old_book_updater
9797

9898

99-
@pytest.mark.xfail
10099
def test_update_books(testgen_config: pathlib.Path) -> None:
101100
with patch_book_updater():
102101
updater.update(content_type="books")

0 commit comments

Comments
 (0)