Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Which LibTIFF to use?
Forum Updated to NodeBB v4.3 + New Features

Which LibTIFF to use?

Scheduled Pinned Locked Moved Unsolved 3rd Party Software
13 Posts 2 Posters 6.2k Views 2 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.
  • B Offline
    B Offline
    Bart_Vandewoestyne
    wrote on last edited by
    #1

    We are building Qt 4.8.7 ourselves (and cannot upgrade to 5.X yet), and during the configure step, one has the options

        -no-libtiff ........ Do not compile TIFF support.
        -qt-libtiff ........ Use the libtiff bundled with Qt.
     +  -system-libtiff .... Use libtiff from the operating system.
                             See http://www.libtiff.org
    

    From src\3rdparty\libtiff\VERSION I learn that the LibTIFF version that comes with Qt 4.8.7 is LibTIFF 4.0.3 from 22 september 2012. From http://www.simplesystems.org/libtiff/ I learn that the latest version is 4.0.7.

    I am wondering what are the reasons for choosing either -qt-libtiff or -system-libtiff (which appears to be the default). The only reason I can think of for prefering -system-libtiff over -qt-libtiff is that it allows to use a more recent version of LibTIFF.

    What could be reasons for choosing either -qt-libtiff or -system-libtiff? What are the advantages or disadvantages for a particular choice?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      It allows to build the tiff plugin on platforms that don't provide libtiff natively like Windows.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • B Offline
        B Offline
        Bart_Vandewoestyne
        wrote on last edited by
        #3

        Hmm... I am rather confused now :-) With Qt 4.8.7 comes LibTIFF 4.0.3 (under src\3rdparty\libtiff). If I use -qt-libtiff, then if I understand things correctly, it will compile thát LibTIFF to a plugin. But what if I want to use my own build of a later version of LibTIFF (say 4.0.7)? Is that what -system-libtiff is for? If 'yes', then how does Qt know where my own compiled LibTiff 4.0.7 is located?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You can use the -I and -L options to pass the path to your custom build of libtiff.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          B 1 Reply Last reply
          0
          • B Offline
            B Offline
            Bart_Vandewoestyne
            wrote on last edited by
            #5

            Ok. Thanks. That makes sense. However, my original question remains: are there any reasons for preferring -system-libtiff over -qt-libtiff? The only one that I can think of is the ability to use a more recent version of LibTIFF.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              That's the usual yes.

              And beside more recent version, there are also the security fixes that may be delivered by distributions.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • B Offline
                B Offline
                Bart_Vandewoestyne
                wrote on last edited by
                #7

                Thanks for confirming.

                And now that we have talked about the advantages of using -system-libtiff, maybe we should also discuss the possible disadvantages? ;-)

                For example, I can imagine that things do not always work as expected when using a more recent LibTIFF version than the one that comes bundled with Qt? This blog post advises against using -system-libtiff because "sometime images cannot be correctly displayed" and refers to QTBUG-11453 which is about the very similar -qt-libpng configure option.

                If anyone else experienced similar problems when using their own build of LibTIFF, i would be happy to hear!

                1 Reply Last reply
                0
                • SGaistS SGaist

                  You can use the -I and -L options to pass the path to your custom build of libtiff.

                  B Offline
                  B Offline
                  Bart_Vandewoestyne
                  wrote on last edited by
                  #8

                  @SGaist While looking at how we configure and build our Qt 4.8.7 right now, i see not libtiff-related configure options, which means that the default -system-libtiff is used. However, we are building on Windows and do not specify any -I or -L options. So I am wondering whether the Qt build actually finds a LibTIFF library, and if this is the case, which one is used. Any ideas on how to check that?

                  For the record: in our Qt-install directory, there are files like qtiff4.dll and qtiffd4.dll under plugins/imageformats/.

                  Or does -system-libtiff defaults to -qt-libtiff if no system libtiff is found?

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    If you don't pass anything the configure script will try to use the system library and if it fails to find it fallback to its own version. If you take a look at the output of configure --help you'll see the defaults the configure script will try to use.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    B 1 Reply Last reply
                    0
                    • SGaistS SGaist

                      If you don't pass anything the configure script will try to use the system library and if it fails to find it fallback to its own version. If you take a look at the output of configure --help you'll see the defaults the configure script will try to use.

                      B Offline
                      B Offline
                      Bart_Vandewoestyne
                      wrote on last edited by
                      #10

                      @SGaist said in Which LibTIFF to use?:

                      If you don't pass anything the configure script will try to use the system library and if it fails to find it fallback to its own version.

                      I just checked this. We are not passing anything TIFF-related to the configure script, which means that we are using the default -system-libtiff. However, it looks like our system TIFF library is not found, since I noticed that the code under QT_SRC_ROOT\src\3rdparty\libtiff does gets built. I checked that by introducing a syntax error in src\3rdparty\libtiff\libtiff\tif_print.c and then noticing that our Qt build failed when compiling the 3rdparty libtiff project.

                      For as far as I understand it now, I will have to use -system-libtiffwith the correct -I and -L options to really make sure we are using our own build of the TIFF library. I will try that and report my findings. Stay tuned! ;-)

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        Where is your system libtiff located ?

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        B 1 Reply Last reply
                        0
                        • SGaistS SGaist

                          Where is your system libtiff located ?

                          B Offline
                          B Offline
                          Bart_Vandewoestyne
                          wrote on last edited by
                          #12

                          @SGaist said in Which LibTIFF to use?:

                          Where is your system libtiff located ?

                          We are building on a Windows 7 system using VS2012 and compile LibTIFF ourselves. The header files are in D:\some\path\to\libtiff and the debug and release .lib files are in D:\some\path\to\libtiff\vc11. I assume these directories are the ones to use with the -I and -L options for -system-libtiff? (I still haven't found time to try that out, I will report later)

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #13

                            Yes

                            AFAIK, Windows doesn't have any system libtiff.

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            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