Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. PySide Image Formats
Forum Updated to NodeBB v4.3 + New Features

PySide Image Formats

Scheduled Pinned Locked Moved Language Bindings
4 Posts 3 Posters 5.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tbcpp
    wrote on last edited by
    #1

    I'm trying to use windows with PySide. However my code that ran fine in Linux doesn't want to work in windows. I'm creating a QImage and then using loadFromData() to load the data from a string. The image format is JPEG which is normally supported via a plugin. However that plugin doesn't seem to have been installed with PySide. I tried using addLibraryPath to point to the plugins but that didn't work either. I still get a isNull() == true image back.

    *edit * It seems that the issue is that PySide isn't loading any plugins.

    Here's what I currently have:

    @from PySide.QtGui import QImage
    from PySide.QtGui import *
    from PySide.QtCore import *

    import sys

    app = QApplication(sys.argv)
    app.addLibraryPath("f:\tmp\imageformats")
    app.addLibraryPath("f:\tmp")

    for v in QCoreApplication.libraryPaths():
    print v
    for v in QImageReader.supportedImageFormats():
    print v
    app.flush()
    img = QImage();
    img.load("c:\tmp\hp.JPG");
    if img.isNull():
    print "failed"
    else:
    print "works"@

    Still, no matter what I do, It always fails. The list out of formats includes .pngs which load fine. But the .jpg plugins are not loading. And therefore fail.
    Any ideas?

    1 Reply Last reply
    0
    • R Offline
      R Offline
      renato.filho
      wrote on last edited by
      #2

      This is a bug on PySide windows package, they do not contain the necessary Qt plug ins. I recommend to you, remove the Qt dll installed with Pyside package, and install the official Qt package.

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tbcpp
        wrote on last edited by
        #3

        That did the trick! I copied the contents of the Qt/bin directory into the Python26/Lib/site-packages/PySide overwriting all the QT files there. And it works like a charm.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mairas
          wrote on last edited by
          #4

          tbcpp, Roman Lacko (the guy who volunteered to do the Windows packaging) told he's aware of the issue and the next installer contains the plugins (including a currently missing sqllite plugin).

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved