You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When imgkit.from_string is called with "--quiet" being passed as argument and the result data is retrieved as in-memory image, so from_string's second parameter set to false the function "to_img" will raise an UnicodeDecodeError exception due to the stderr = stderr or stdout statement. It will cause the image to be stored in stderr which will fail just in the line below when .decode("utf-8") is executed on the binary data.
To Reproduce
Call imgkit.from_string("hello world", False, options) with options defining {"format": "png", "quiet": None}.
Code will crash in line 242 at stderr = stderr.decode("utf-8") of imgkit.py because stderror will contain the png's byte data which can not be decoded.
Expected behavior
No exception should be raised.
Environment
OS: Ubuntu 20.02
IMGkit Version 1.1.
wkhtmltopdf Version wkhtmltoimage 0.12.6 (with patched qt)
Additional context
Overriding the lines with 43-45 with
Describe the bug
When imgkit.from_string is called with "--quiet" being passed as argument and the result data is retrieved as in-memory image, so from_string's second parameter set to false the function "to_img" will raise an UnicodeDecodeError exception due to the
stderr = stderr or stdout
statement. It will cause the image to be stored in stderr which will fail just in the line below when.decode("utf-8")
is executed on the binary data.To Reproduce
Call imgkit.from_string("hello world", False, options) with options defining {"format": "png", "quiet": None}.
Code will crash in line 242 at
stderr = stderr.decode("utf-8")
of imgkit.py because stderror will contain the png's byte data which can not be decoded.Expected behavior
No exception should be raised.
Environment
wkhtmltopdf
Version wkhtmltoimage 0.12.6 (with patched qt)Additional context
Overriding the lines with 43-45 with
fixed the issue for me.
The text was updated successfully, but these errors were encountered: