Cloned from csquared to fix these bugs:
-
Don't spawn new
wkhtmltoimageand continue execution: wait for them to terminate! -
Recognize that
TempFileis a file.
The problem with 1. was that, while wkhtmltoimage was still running, the
(only partially) rendered image was being uploaded to S3, causing broken images.
The problem with 2. was that, since wkhtmltoimage does not work with HTML in STDIN,
the HTML must be stored in a temporary file, and the original IMGKit thinks that
Tempfile instances are not files.