lilohuang/PyTurboJPEG

Encoding exception with Python 3

srijiths opened this issue · 1 comments

Hi @lilohuang,

I was using turboJPEG with python 2.7 and it was working fine. I was using
https://downloads.sourceforge.net/project/libjpeg-turbo/2.0.2/libjpeg-turbo-official_2.0.2_amd64.deb and your latest code repo.
But when i migrated to python 3.7, the same fucntions which was working before is creating some exceptions. Please see the exceptions stack trace below.

Traceback (most recent call last):
  File "/opt/code/faceid/utils.py", line 86, in convert_img_to_buffer
    jpg_as_text = turbo.encode(frame, quality=95)
  File "/usr/local/lib/python3.7/site-packages/turbojpeg.py", line 219, in encode
    self.__report_error(handle)
  File "/usr/local/lib/python3.7/site-packages/turbojpeg.py", line 235, in __report_error
    raise IOError(self.__get_error_string(handle))
OSError: tjCompress2(): Invalid argument

I am unable to understand what is the issue here. Can you please point me.

Thanks,
Srijith

@lilohuang My bad !! It was an image issue. Sorry to trouble you,