wagtail / Willow

A wrapper that combines the functionality of multiple Python image libraries into one API
https://willow.wagtail.org/
BSD 3-Clause "New" or "Revised" License
273 stars 53 forks source link

Convert PNG in mode CMYK Fix #107

Closed ghost closed 1 year ago

ghost commented 1 year ago

Summary

This PR fixes issue #106 where PNG writing fails if the image is in mode CMYK.

Fix

Add check following the same format as save_as_jpeg where we convert the image to RGB mode if the current mode is CMYK

zerolab commented 1 year ago

Would be great to get a small sample image and have a test for it.

ghost commented 1 year ago

@zerolab test added!

kaedroho commented 1 year ago

@stanpresshook thanks a lot for this, the code looks good to me but the test is currently failing. Please could you look into that, I'd be happy to merge this once it's fixed!

zerolab commented 1 year ago

closing in favour of #123 (which rebases on main and tidies up the code). Thanks @stanpresshook