New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wx.html2.WebView with WebKit 2 does not display pictures from the disk #1071

Open
Jenyay opened this Issue Nov 4, 2018 · 17 comments

Comments

Projects
None yet
2 participants
@Jenyay
Copy link
Contributor

Jenyay commented Nov 4, 2018

Operating system: Ubuntu 18.04
wxPython version & source: wxPython 4.0.1, 4.0.3
Python version & source: Python 3.6

If you install wxPython using WebKit 2, then images with relative paths or with the file: // protocol will not be displayed. Everything works fine with WebKit 1.

I think this error is related to #981.

@swt2c

This comment has been minimized.

Copy link
Contributor

swt2c commented Nov 5, 2018

Can you provide a specific example of html that doesn't work for you? I am not seeing any problems with relative or file URLs.

@Jenyay

This comment has been minimized.

Copy link
Contributor Author

Jenyay commented Nov 5, 2018

@swt2c I made a minimal example where the problem is being observed. - testwebkit.zip

@swt2c

This comment has been minimized.

Copy link
Contributor

swt2c commented Nov 6, 2018

Thanks for the example. Unfortunately, I still don't see the problem when using your example. I tried on Fedora 29 and Ubuntu 18.04 - in both cases I tried the distribution packages for wxPython (version 4.0.1).

@Jenyay

This comment has been minimized.

Copy link
Contributor Author

Jenyay commented Nov 6, 2018

Probably these packages are compiled using WebKit 1. I also don’t see problems if I install wxPython 4.0.3 in Ubuntu 18.04. The problem is observed if I install wxPython 4.0.3 in Ubuntu 16.04 or compile from source using WebKit 2.

@Jenyay

This comment has been minimized.

Copy link
Contributor Author

Jenyay commented Nov 6, 2018

I updated the example to it show engine version - testwebkit_2.zip

In Ubuntu 18.04 + wxPython 4.0.3 from the wheels everything is working:

webkit_ok

In Ubuntu 18.04 + wxPython 4.0.3 from the compiled sources no images are displayed:

webkit_error

Similarly in Ubuntu 16.04 + wxPython 4.0.3 from the wheels.

@swt2c

This comment has been minimized.

Copy link
Contributor

swt2c commented Nov 8, 2018

Probably these packages are compiled using WebKit 1. I also don’t see problems if I install wxPython 4.0.3 in Ubuntu 18.04. The problem is observed if I install wxPython 4.0.3 in Ubuntu 16.04 or compile from source using WebKit 2.

Nope, Fedora 29 doesn't even have WebKit 1 packages, and the Ubuntu 18.04 wxwidgets package was build with WebKit2, see build log here:
https://launchpadlibrarian.net/362519168/buildlog_ubuntu-bionic-amd64.wxwidgets3.0_3.0.4+dfsg-3_BUILDING.txt.gz

@Jenyay

This comment has been minimized.

Copy link
Contributor Author

Jenyay commented Nov 8, 2018

Do I understand correctly that if Ubuntu has libwebkitgtk-3.0, then the compilation will be with WebKit 1, and if there is libwebkit2gtk-4.0, then WebKit 2?

@Jenyay

This comment has been minimized.

Copy link
Contributor Author

Jenyay commented Nov 8, 2018

Is there a way to explicitly specify the required version of WebKit?

@swt2c

This comment has been minimized.

Copy link
Contributor

swt2c commented Nov 9, 2018

The wxWidgets build process will search for WebKit2 first, and if not found, it will search for WebKit1. Unfortunately, no there isn't a way to specify WebKit1 only, other than removing the WebKit2 development package so it will not be found.

@Jenyay

This comment has been minimized.

Copy link
Contributor Author

Jenyay commented Nov 9, 2018

I compiled (Ubuntu 18.04) and uploaded wheel with which there is a problem. https://drive.google.com/drive/folders/12LqBgdQPWw0BcetRLJ0iVicpa0rKzTul?usp=sharing

Try the example above with this version.

@Jenyay

This comment has been minimized.

Copy link
Contributor Author

Jenyay commented Dec 18, 2018

Can you reproduce the problem?

@swt2c

This comment has been minimized.

Copy link
Contributor

swt2c commented Dec 19, 2018

No, but I did not try your wheel.

@Jenyay

This comment has been minimized.

Copy link
Contributor Author

Jenyay commented Jan 9, 2019

I understand when an error occurs. The error appears if there are non-Latin characters on the path to the file being opened. For example if the previous script is located at /home/jenyay/temp/webkit/test/ then everything works fine. The error occurs when the script is placed at /home/jenyay/temp/webkit/проверка/

@swt2c

This comment has been minimized.

Copy link
Contributor

swt2c commented Jan 10, 2019

Aha! That would explain why I could not reproduce it. I can reproduce now in wxWidgets. I'll look into the issue.

@Jenyay

This comment has been minimized.

Copy link
Contributor Author

Jenyay commented Jan 10, 2019

I noticed that in the same case external JavaScript files are not loaded, perhaps, still CSS files, but I did not tested.

@swt2c

This comment has been minimized.

Copy link
Contributor

swt2c commented Jan 11, 2019

As far as I can tell, this is a bug in WebKit2 itself. It is refusing to load those images. I am reporting it upstream.

@Jenyay

This comment has been minimized.

Copy link
Contributor Author

Jenyay commented Jan 12, 2019

A bug is similar to a known issue - https://bugs.webkit.org/show_bug.cgi?id=184660. Unfortunately, they are not going to solve it.

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