src/plugins/imageformats/ico/qicohandler.cpp
branchRCL_3
changeset 5 d3bac044e0f0
parent 4 3b1da2848fc7
child 7 3f74d0d4af4c
equal deleted inserted replaced
4:3b1da2848fc7 5:d3bac044e0f0
   554                 if (icoAttrib.depth == 32)                // there's no colormap
   554                 if (icoAttrib.depth == 32)                // there's no colormap
   555                     icoAttrib.ncolors = 0;
   555                     icoAttrib.ncolors = 0;
   556                 else                    // # colors used
   556                 else                    // # colors used
   557                     icoAttrib.ncolors = header.biClrUsed ? header.biClrUsed : 1 << icoAttrib.nbits;
   557                     icoAttrib.ncolors = header.biClrUsed ? header.biClrUsed : 1 << icoAttrib.nbits;
   558                 icoAttrib.w = iconEntry.bWidth;
   558                 icoAttrib.w = iconEntry.bWidth;
       
   559                 if (icoAttrib.w == 0)
       
   560                     icoAttrib.w = header.biWidth;
   559                 icoAttrib.h = iconEntry.bHeight;
   561                 icoAttrib.h = iconEntry.bHeight;
       
   562                 if (icoAttrib.h == 0)
       
   563                     icoAttrib.h = header.biHeight/2;
   560 
   564 
   561                 QImage::Format format = QImage::Format_ARGB32;
   565                 QImage::Format format = QImage::Format_ARGB32;
   562                 if (icoAttrib.nbits == 24)
   566                 if (icoAttrib.nbits == 24)
   563                     format = QImage::Format_RGB32;
   567                     format = QImage::Format_RGB32;
   564                 else if (icoAttrib.ncolors == 2)
   568                 else if (icoAttrib.ncolors == 2)