Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-79275

QQC2: libqtquickcontrols2imaginestyleplugin should be much smaller

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.14
    • Fix Version/s: 5.14.0 RC1
    • Component/s: Quick: Controls 2
    • Labels:
      None
    • Commits:
      17cc497f16ea5e2d722db422e2c6611e107f62a8 (qt/qtquickcontrols2/5.13)

      Description

      The libqtquickcontrols2imaginestyleplugin.so (or dll, etc.) is ~2MB big. The 1288 images in qtquickcontrols2/src/imports/controls/imagine/images take ~1.5MB.

      Just by compressing the png files via optipng -o 7 -strip all, the 1288 images shrink to ~0.8MB.

      Example of how a png can losslessly shrink:

      c:\Users\alportal\dev\qt5\qtquickcontrols2\src\imports\controls\imagine\images>optipng -o 7 -strip all tooltip-background@4x.9.png
      ** Processing: tooltip-background@4x.9.png
      102x126 pixels, 4x8 bits/pixel, RGB+alpha
      Reducing image to 8 bits/pixel, 20 colors (18 transparent) in palette
      Stripping metadata...
      Input IDAT size = 1442 bytes
      Input file size = 1515 bytes
      
      Trying:
        zc = 9  zm = 9  zs = 0  f = 0         IDAT size = 257
        zc = 9  zm = 8  zs = 0  f = 0         IDAT size = 257
        zc = 9  zm = 9  zs = 1  f = 0         IDAT size = 256
        zc = 9  zm = 8  zs = 1  f = 0         IDAT size = 256
      
      Selecting parameters:
        zc = 9  zm = 8  zs = 1  f = 0         IDAT size = 256
      
      Output IDAT size = 256 bytes (1186 bytes decrease)
      Output file size = 415 bytes (1100 bytes = 72.61% decrease)
      

      Those ~0.7MB difference would also apply to the libqtquickcontrols2imaginestyleplugin.so, since the png files are included as resources.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              mitch_curtis Mitch Curtis
              Reporter:
              portale Alessandro Portale
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes