Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSError: cannot write mode RGBA as JPEG #44

Open
tristanlatr opened this issue Sep 12, 2020 · 0 comments
Open

OSError: cannot write mode RGBA as JPEG #44

tristanlatr opened this issue Sep 12, 2020 · 0 comments

Comments

@tristanlatr
Copy link

Hello,

Thanks for this tool, I'm trying to process diff on a PDF of 250 pages plus and getting this error. It works with 'png' format but it barely readable and images reader hangs because the file is too large...

Calling

% pdf-diff -f jpeg v1.pdf v2.pdf > diff.jpeg

I Get:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/PIL/JpegImagePlugin.py", line 614, in _save
    rawmode = RAWMODE[im.mode]
KeyError: 'RGBA'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/bin/pdf-diff", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/site-packages/pdf_diff/command_line.py", line 499, in main
    img.save(sys.stdout.buffer, args.format.upper())
  File "/usr/local/lib/python3.8/site-packages/PIL/Image.py", line 2158, in save
    save_handler(self, fp, filename)
  File "/usr/local/lib/python3.8/site-packages/PIL/JpegImagePlugin.py", line 616, in _save
    raise OSError("cannot write mode %s as JPEG" % im.mode) from e
OSError: cannot write mode RGBA as JPEG

I'm on macOS Catalina.
Thanks for your help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant