crop_thesis_covers.py returns a black+white image when cropping
keelinm opened this issue · 3 comments
keelinm commented
Marina found that when she uploaded Lief22.png to the content/images/theses folder the script crop_thesis_covers returns it in a black and white version.
keelinm commented
I did a short investigation and noticed a few things:
- The script only looks for png images. Nikolas uploaded most phd covers in bulk in png format a few months ago. I noticed that Chle22 thesis cover was uploaded in jpeg format so I think this script did not even run on that file?? I think we should re-upload it in png format.
- Nikolas uploaded thesis covers quite small (e.g. Balt19c.png was uploaded at 282x400 pixels in original format) while the recent ones added are much larger. I think it's better to keep them smaller before uploading.
- I could reproduce the bug. Comparing the output on Balt19c.png (which works fine) and Lief22.png (which comes out black and white) the stdout reports the following:
Resized Balt19c.png from (400, 282, 3) to (397, 282, 3)
Resized Lief22.png from (1934, 1345) to (1894, 1345)
So it seems like Lief22.png is in some different format (doesn't have 3 channels when opened by imageio) although it looks like a normal colour image in my viewer.
I stopped here because I don't have familiarity with imageio and thought @martvanrijthoven might recognize this issue more quickly?
keelinm commented
martvanrijthoven commented
Image did not contain color channels, fixed now. Also added jpeg and jpg support in crop thesis script