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
PyQt missing SVG, JPG, TIFF and other support in QImageReader #131
Comments
Here is the solution: http://stackoverflow.com/questions/14556841/how-to-load-ico-files-in-pyqt4-from-network
|
This solution doesn't work for me, be it on PySide or PyQt4 (and even if it did, it should not be necessary). |
@Nodd could you test if this is fixed in the latest packages provided by conda? |
On OSX the latest version of PyQt4 does not have JPEG/JPG. |
The
Please verify that it's working for you. |
These are the files in /anaconda/lib/qt4/plugins
While this is the output of
|
I also added these paths with the same result.
|
So the only unsupported one is Jpeg, but I don't know why as we provide the Qt plugin for it :-/ |
Anything else I can do to debug this? |
I am unable to render SVG images in Orange3 when Anaconda is installed. Here are my available image formats: >>> print("PyQt4 installed in", os.path.dirname(PyQt4.__file__))
PyQt4 installed in /home/brylie/anaconda3/lib/python3.5/site-packages/PyQt4
>>> print("Qt4 library paths", QApplication.libraryPaths())
Qt4 library paths []
>>> print([bytes(f).decode("ascii") for f in QImageReader.supportedImageFormats()])
['bmp', 'pbm', 'pgm', 'png', 'ppm', 'xbm', 'xpm'] |
As a previous comment suggested, I looked under the
I notice SVG in both locations, but SVG is not listed in >>> print([bytes(f).decode("ascii") for f in QImageReader.supportedImageFormats()])
['bmp', 'pbm', 'pgm', 'png', 'ppm', 'xbm', 'xpm'] |
I am experiencing the same problem with anaconda 4.1.6 on OSX (missing SVG support). I can work around the issue by moving the qt.conf from anaconda/bin to anaconda/python.app/Contents/Resources. |
Thanks @astaric. I don't have a
To which folder should I copy qt.conf? |
@astaric, thanks a lot for the suggestion. I'll add it to our next build of Qt4 :-) |
@brylie, you need to install
|
Thanks @ccordoba12. Here is the output of that command:
When searching for the python.app, three packages appear:
Note, I am on GNU/Linux. Is the python.app necessary? |
|
Hi, I'm jumping into the issue. On a fresh install of Mac OS X El capitan, fresh install of anaconda3 (conda 4.2.12), fresh install of pyqt4, I don't have the directory Also, I tried @astaric 's solution: I installed What can I try ? |
Should I open a new issue ? @astaric , could you post the content of the qt.conf file you put in anaconda/python.app/Contents/Resources please ? |
We're probably not going to update Qt4/PyQt4 anymore. Is this problem still present in Qt5? |
I don't know, but I can check if you want. For now, I have a huge software developed with PyQt4 and I don't intend to port it to qt5 anytime soon. Is there a way/tweak I can make PyQt4 work for now ? First, is it normal I don't have the directories as the others ? I don't have the directory ~/anaconda3/lib/qt4/, for example. |
I checked it, and our Qt5 packages support all these formats out of the box.
You could use qtpy to quite easily do the porting job. That's a compatibility library to work seamlessly with PyQt4 and PyQt5 in the same codebase.
I don't think so, it seems to have this we'd need to recompile Qt4 and PyQt4. You have two alternatives here:
|
This is totally crazy 2016 and PyQt4 has problems with something as basic as a JPEG. We should be in flying cars by now, what is this. I'm having the same issue. Deployed software and on some platforms the image dlls refuse to load with a frozen executable. Had to use Pillow to convert the images manually to PNG. That works but not a great solution. Can anyone confirm Qt5 works with JPEG? |
Yes, Qt5 works with jpeg. However, Qt4 is not to blame here. I can work with it on linux and windows without problem. |
Qt5 is 4 years old now. The amount of code change required to adapt Qt4 code to work on Qt5 is minimal: https://wiki.qt.io/Transition_from_Qt_4.x_to_Qt5. I expect PyQt and qtpy make the transition even easier. Please do your project(s) a favour and make those changes. |
Actually Qt4 is to blame. When you deploy the software as a frozen executable some systems will not correctly load the plugins. This is true for pyinstaller and others. It depends on the system. Deployed my applications work on 99% of the systems. But some users can't get jpegs because the plugin won't load. This is a known issue. Hooks don't work, even directly loading the plugin in the source code doesn't work. It simply will not load. I've spent two days on this bug. Had to convert every jpg to png. |
Is it because the system doesn't properly loads the plugin, or because anaconda puts it in the wrong place ? |
This just happens because we (i.e. Continuum) don't provide those plugins, that's all. To restate our position: Qt4 is not supported by us anymore. You're very welcome to hire us to add support for it in your projects if that's a priority for you. If that alternative is not suitable, you have the option of sending a pull request against the qt conda-forge feedstock for all operating systems. Those recipes are the same ones we used internally, so we could pick your work and provide new packages for Qt4 on Continuum's side. I hope our position is clear now. |
It's not a problem for me anymore. I ported my code to Qt5 (it just required 2 days of work, that's not much). Now jpeg images load properly, but I have other issues with freezing my app (but it's another story). If you don't support pyqt4 anymore, shouldn't we close the issue as "won't fix" ? |
Won't fix |
The pyqt available through
conda install pyqt
only supports the following.The Qt4 documentation list several more.
Could this be due to missing configuration during compilation?
I am running conda 3.5.5 on Win32.
The text was updated successfully, but these errors were encountered: