Skip to content

imgkit should raise exception if wkhtmltoimage returns with non zero exit code #122

Description

@ronald

if libssl1.0-dev is missing and html contains https-style-sheet link it fails silently to load css:

<link href="https://example.com/style.css" rel="stylesheet" />

Expected behavior

ImgKit should raise exception

Current Behavior

ImgKit renders HTML without styles

Possible Solution

Check exit status of wkhtmltoimage.

 sudo apt remove libssl1.0-dev
 bundle exec wkhtmltoimage tmp/code.html tmp/code.jpg

output:

Loading page (1/2)
QSslSocket: cannot resolve CRYPTO_num_locks                  ] 10%
QSslSocket: cannot resolve CRYPTO_set_id_callback
QSslSocket: cannot resolve CRYPTO_set_locking_callback
QSslSocket: cannot resolve sk_free
QSslSocket: cannot resolve sk_num
QSslSocket: cannot resolve sk_pop_free
QSslSocket: cannot resolve sk_value
QSslSocket: cannot resolve SSL_library_init
QSslSocket: cannot resolve SSL_load_error_strings
QSslSocket: cannot resolve SSLv3_client_method
QSslSocket: cannot resolve SSLv23_client_method
QSslSocket: cannot resolve SSLv3_server_method
QSslSocket: cannot resolve SSLv23_server_method
QSslSocket: cannot resolve X509_STORE_CTX_get_chain
QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf
QSslSocket: cannot resolve OPENSSL_add_all_algorithms_conf
QSslSocket: cannot resolve SSLeay
QSslSocket: cannot call unresolved function CRYPTO_num_locks
QSslSocket: cannot call unresolved function CRYPTO_set_id_callback
QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function sk_num
QSslSocket: cannot call unresolved function SSLv23_client_method1%
QSslSocket: cannot call unresolved function SSL_library_init
Rendering (2/2)                                                    
Done                                                               
Exit with code 1 due to network error: UnknownNetworkError
QSslSocket: cannot call unresolved function CRYPTO_num_locks
QSslSocket: cannot call unresolved function CRYPTO_set_id_callback
QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback

check exit code:

 echo $?

output:
1

 sudo apt install libssl1.0-dev
 bundle exec wkhtmltoimage tmp/code.html tmp/code.jpg

output:

Loading page (1/2)
Rendering (2/2)                                                    
Done       

check exit code:

 echo $?

output:
0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions