4

I am using wkhtmltoimage and everything was going well until I ask it to do a screenshot of twitter and I got this weird error:

Loading page (1/2)
WARNING: Phonon needs QCoreApplication::applicationName to be set to export audio output names through the DBUS interface 
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
Rendering (2/2)                                                   
Done

Here is the command I used:

xvfb-run wkhtmltoimage --format png --quality 100 http://twitter.com/jnbdz twitter2.png

I am using Ubuntu 11, Apache2/PHP5 and Qt4.

I am not getting this error when I am trying to get a screenshot of Google or other websites.

When it works, I only get this: http://dl.dropbox.com/u/20599297/twitter3.png

Any ideas what could be causing this error?

UPDATE

I am getting a different error when trying to do a screenshot of yahoo.com:

xvfb-run wkhtmltoimage --format png --quality 100 http://yahoo.com/ yahoo1.png


Loading page (1/2)
Error: Failed loading page http://yahoo.com/ (sometimes it will work just to ignore this error with --load-error-handling ignore)
Error: Failed loading page http://yahoo.com/ (sometimes it will work just to ignore this error with --load-error-handling ignore)
jnbdz
  • 4,863
  • 9
  • 51
  • 93

1 Answers1

0

Ok, so, in order:

1/ wkhtmltoimage uses Webkit, which may be loading Phonon for a number of reasons. In order to render multimedia Web contents, for instance. It's not very important, though.

2/ Some audio-related Phonon features require an application name to be set. You probably don't need those features to render the Web page, so don't worry about that warning.

3/ Phonon attempts then fails to connect to the Jack audio server, presumably as it scans for available audio output systems. You don't need audio anyway, so you can ignore those errors too.

4/ As far as I know, Twitter makes heavy use of JavaScript for its rendering. I don't know that wkhtmltoimage ships with a JavaScript interpreter. Rendering issues are thus almost guaranteed.

You must understand that the method used in wkhtmltoimage is somewhat primitive and not very robust. It will fail in a number of cases, first and foremost when dealing with dynamic content.

You may have better luck with the mobile version at http://mobile.twitter.com/, though.

As to the Yahoo errors, they appear to be connection errors that have nothing to do with any of the above.

Balinares
  • 96
  • 1
  • 7