Under Python3.4, calling .save() on an JPEGImage object raises the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.4/site-packages/jpegtran/transform.py", line 221, in save
fp.write(self.data)
TypeError: must be str, not bytearray
In transform.py line 220 we see that the file is opened in regular string mode (w) as opposed to binary mode (wb) which is required to write bytearrays.
Under Python3.4, calling .save() on an JPEGImage object raises the following exception:
In transform.py line 220 we see that the file is opened in regular string mode (
w
) as opposed to binary mode (wb
) which is required to write bytearrays.Workaround: change transform.py line 220 from:
to: