rstudio / webshot2

Take screenshots of web pages from R

Home Page:https://rstudio.github.io/webshot2/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

version 0.1.1 creates blank png files on Windows 10

massimoaria opened this issue · comments

The new version 0.1.1 returns blank png files from HTML generated with visNetwork::visSave.
This happens only on Windows machines. The package works fine on Linux and Mac.
Trying to downgrade to 0.1.0, the function webshot returns to working perfectly.

Hi @massimoaria, can you share more information about which browser you're using with chromote (chromote::find_chrome() may help there) and the specific version of that browser?

HI @gadenbuie ,
here is what find_chrome() returns on my Windows PC:

chromote::find_chrome()
[1] "C:\Program Files\Google\Chrome\Application\chrome.exe"

Google chrome version:
119.0.6045.125 (Official Build) (64 bit)

I attached also an example of HTML file generated by visSave that webshot() returns as an empty PNG file.
file23f036e8ef2_files.zip

My workflow is the following:

  1. In a shiny dashboard (biblioshiny included in the package Bibliometrix), create a dynamic network object "p" through visNetwork package
  2. Save the object using the function visSave as an HTML file (that I attached here)
    visSave(p, html_filename)
  3. Creata a PNG file from the HTML using webshot
    webshot2::webshot(url = html_filename, zoom = 1, file = filename_png)

If I use the webshot2 0.1.0 the PNG file is perfect while using the new 0.1.1 version, the PNG file is empty (only 15kb instead of 700kb).

I checked the issue on 4 different Windows machines with different browsers based on Chrome engine (i.e. Edge, Opera, Chrome) and the results are the same: 0.1.0 works, 0.1.1 doesn't work.

For the moment, I added a workaround in my shiny app that checks the webshot2 version and installs the 0.1.0 if necessary.

Same issue when saving Leaflet maps to png. Downgrading to 0.1.0 did not work unfortunately. chromote::find_chrome() returns a valid Chrome location.

Curiously, saving jpeg does seem to work.

commented

Same on Ubuntu 22.04.3 LTS, though v0.1.0 works. Minimal example here.

$ google-chrome --version
Google Chrome 125.0.6422.60