Results 1 to 7 of 7

Thread: Loading TIF images in Ubuntu

  1. #1
    Join Date
    Jan 2006
    Location
    Knivsta, Sweden
    Posts
    153
    Thanks
    30
    Thanked 13 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Loading TIF images in Ubuntu

    I have some problems loading TIF images using Qt.

    Googling gave me this:
    http://doc.qt.io/qt-5/qtimageformats-index.html

    The actual coding and decoding of the file format is done by a codec library. The codec can be Qt or third party code. In case of a third party codec, the build process will look for it among the system libraries. If not found, it may fall back on using a bundled copy (in src/3rdparty).

    On my own machine (Linux Mint 17.1, Qt 5.3.2 compiled from source), the return value of
    Qt Code:
    1. QImageReader::supportedImageFormats()
    To copy to clipboard, switch view to plain text mode 
    includes "tif" and "tiff". and consequently such images load fine.

    On a friend's machine (Ubuntu 14.04, Qt 5.2.1 that came with the installation), supportedImageFormats() does not include "tif". However,

    Qt Code:
    1. locate libtiff
    To copy to clipboard, switch view to plain text mode 
    on the command prompt shows
    /usr/lib/x86_64-linux-gnu/libtiff.so.5
    /usr/lib/x86_64-linux-gnu/libtiff.so.5.2.0

    As per the quote above, I expected Qt to find the codec "among the system libraries". What need to be done to ensure that?
    Last edited by drhex; 11th June 2015 at 08:12.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Loading TIF images in Ubuntu

    First of all check if your friend's Qt installation includes qtiff plugin like your does.

    $ ls -1 /usr/lib/x86_64-linux-gnu/qt4/plugins/imageformats

    libqgif.so
    libqico.so
    libqjpeg.so
    libqmng.so
    libqsvg.so
    libqtga.so
    libqtiff.so
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jan 2006
    Location
    Knivsta, Sweden
    Posts
    153
    Thanks
    30
    Thanked 13 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: Loading TIF images in Ubuntu

    Yes, he gets the exact same list of libraries, including libqtiff.so

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Loading TIF images in Ubuntu

    Does running ldd on libqtiff.so report any missing dependencies? Make sure you are checking the appropriate Qt installation!
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Jan 2006
    Location
    Knivsta, Sweden
    Posts
    153
    Thanks
    30
    Thanked 13 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: Loading TIF images in Ubuntu

    >ldd /usr/lib/x86_64-linux-gnu/qt4/plugins/imageformats/libqtiff.so
    linux-vdso.so.1 => (0x00007fff287c9000)
    libtiff.so.5 => /usr/lib/x86_64-linux-gnu/libtiff.so.5 (0x00007f76882b7000)
    libQtGui.so.4 => /usr/lib/x86_64-linux-gnu/libQtGui.so.4 (0x00007f7687604000)
    libQtCore.so.4 => /usr/lib/x86_64-linux-gnu/libQtCore.so.4 (0x00007f768711e000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f7686e1a000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f7686c04000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f768683e000)
    liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f768661c000)
    libjbig.so.0 => /usr/lib/x86_64-linux-gnu/libjbig.so.0 (0x00007f768640e000)
    libjpeg.so.8 => /usr/lib/x86_64-linux-gnu/libjpeg.so.8 (0x00007f76861b8000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f7685f9f000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7685c99000)
    libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f7685a5c000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f768583e000)
    libaudio.so.2 => /usr/lib/x86_64-linux-gnu/libaudio.so.2 (0x00007f7685626000)
    libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f768531d000)
    libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f76850f7000)
    libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f7684e54000)
    libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f7684c02000)
    libSM.so.6 => /usr/lib/x86_64-linux-gnu/libSM.so.6 (0x00007f76849fa000)
    libICE.so.6 => /usr/lib/x86_64-linux-gnu/libICE.so.6 (0x00007f76847de000)
    libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007f76845cd000)
    libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f76843c3000)
    libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f76841b1000)
    libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f7683e7b000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7683c77000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f7683a6f000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f768874d000)
    libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f7683844000)
    libXt.so.6 => /usr/lib/x86_64-linux-gnu/libXt.so.6 (0x00007f76835de000)
    libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f76833d9000)
    libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f768319b000)
    libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f7682f93000)
    libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f7682d8d000)
    libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f7682b6e000)
    libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f7682967000)

    It seems they're all there.
    My simple testprogram (which doesn't print "tif") looks like so:

    Qt Code:
    1. #include <QApplication>
    2. #include <QImageReader>
    3. #include <QList>
    4.  
    5. int main( int argc, char **argv )
    6. {
    7. QApplication app( argc, argv );
    8.  
    9. QList<QByteArray> foo = QImageReader::supportedImageFormats();
    10. foreach (QByteArray b, foo)
    11. {
    12. qDebug("%s", qPrintable(QString(b)));
    13. }
    14.  
    15. exit(0);
    16. }
    To copy to clipboard, switch view to plain text mode 

    How come libqtiff resides in qt4's plugin directory rather than in qt5's ?

    I tried running strace (a program that logs all syscalls with arguments and return values) on the test program above to possibly get more detailed error-info. The string "tif" was nowhere to be found in the log. There was plenty of references to the qt5/plugin directories, but none to the qt4/plugin directories.
    In desperation, I made a symlink to qt4/plugins/imageformats/libqtiff.se in the corresponding qt5 directory, but to no avail.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Loading TIF images in Ubuntu

    Quote Originally Posted by drhex View Post
    How come libqtiff resides in qt4's plugin directory rather than in qt5's ?
    Apparently you are checking Qt4 installation and not Qt5

    Your friend probably doesn't have the qt5-image-formats-plugins package installed.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. The following user says thank you to wysota for this useful post:

    drhex (12th June 2015)

  8. #7
    Join Date
    Jan 2006
    Location
    Knivsta, Sweden
    Posts
    153
    Thanks
    30
    Thanked 13 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: Loading TIF images in Ubuntu

    Confirmed. Installing qt5-image-formats-plugins fixed the issue.

Similar Threads

  1. Loading 2 images in Same label ->
    By 2lights in forum Qt Programming
    Replies: 3
    Last Post: 18th July 2013, 09:43
  2. Loading images from url in qt 4
    By shalini in forum Newbie
    Replies: 4
    Last Post: 15th September 2011, 17:21
  3. Loading Images from Directory Faster
    By jalm in forum Newbie
    Replies: 1
    Last Post: 24th August 2011, 09:25
  4. Slow loading images
    By abbapatris in forum Qt Programming
    Replies: 10
    Last Post: 5th March 2008, 16:52
  5. Loading images in QTextBrowser
    By nisha0609 in forum Qt Programming
    Replies: 1
    Last Post: 3rd January 2007, 10:44

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.