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

QImageReader::size() reports wrong sizes for .ico files

    XMLWordPrintable

Details

    Description

       QImageReader reader(fn);
          QImage image;
          for (int i = 0; true; ++i) {
              QDebug d = qDebug();
              d << '#' << i << "QImageReader::size()=" << reader.size();
              if (!reader.read(&image))
                  break;
              d << "QImage::size()=" << image.size() << "  \n" << image;
              icon.addPixmap(QPixmap::fromImage(image));
              if (!reader.jumpToNextImage())
                  break;
          }
      

      produces

      debug\qtbug48103.exe ..\qtbug48103\ok.ico
      5.6.0
      loadWithImageReader "..\\qtbug48103\\ok.ico" supportsOption(QImageIOHandler::Size)= true
      # 0 QImageReader::size()= QSize(48, 48) QImage::size()= QSize(48, 48)
       QImage(QSize(48, 48),format=6,depth=32,devicePixelRatio=1,bytesPerLine=192,byteCount=9216)
      # 1 QImageReader::size()= QSize(0, 0) QImage::size()= QSize(32, 32)
       QImage(QSize(32, 32),format=6,depth=32,devicePixelRatio=1,bytesPerLine=128,byteCount=4096)
      # 2 QImageReader::size()= QSize(0, 0) QImage::size()= QSize(16, 16)
       QImage(QSize(16, 16),format=6,depth=32,devicePixelRatio=1,bytesPerLine=64,byteCount=1024)
      # 3 QImageReader::size()= QSize(82, 71) QImage::size()= QSize(256, 256)
       QImage(QSize(256, 256),format=24,depth=8,devicePixelRatio=1,bytesPerLine=256,byteCount=65536)
      # 4 QImageReader::size()= QSize(39, 0) QImage::size()= QSize(128, 128)
       QImage(QSize(128, 128),format=6,depth=32,devicePixelRatio=1,bytesPerLine=512,byteCount=65536)
      
      QIcon::availableSizes= (QSize(48, 48), QSize(32, 32), QSize(16, 16), QSize(256, 256), QSize(128, 128))
      

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-48103
          # Subject Branch Project Status CR V

          Activity

            People

              vgt Eirik Aavitsland
              kleint Friedemann Kleint
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes