NobeKanai / dvtag

A command-line tool designed to tag your doujin voice library. Support mp3/m4a/flac.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error writing to CMYK images

SchroDr opened this issue · comments

If the image on dlsite is in CMYK format, then an error occurs when writing the image.

OSError: cannot write mode CMYK as PNG

I handled this locally, adding code to convert CMYK images to RGB images in utils.py

def get_png_byte_arr(im: Image.Image) -> BytesIO:
    if im.mode == 'CMYK':
        im = im.convert('RGB')
    img_byte_arr = io.BytesIO()
    im.save(img_byte_arr, "png")
    return img_byte_arr

Hope you can also fix the bugs in the github code to avoid similar problems when others use it.
Your code is very useful and convenient. Thank you.

Thank you for sharing this problem. I will handle it as soon as possible.