Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Contributor
alexko
Posts: 7
Registered: ‎01-22-2013
My Device: BB10 Z30
My Carrier: MTS

Re: 10.2 Gold: libpng error: bad parameters to zlib

It seems the problem is still here.

 

Small example which works correctly with 10.1 and fails with 10.2 debug:

 

    static const unsigned char pixel_1x1_png[] = {
          0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52
        , 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x00, 0x00, 0x00, 0x25, 0xDB, 0x56
        , 0xCA, 0x00, 0x00, 0x00, 0x03, 0x50, 0x4C, 0x54, 0x45, 0x00, 0x00, 0x00, 0xA7, 0x7A, 0x3D, 0xDA
        , 0x00, 0x00, 0x00, 0x01, 0x74, 0x52, 0x4E, 0x53, 0x00, 0x40, 0xE6, 0xD8, 0x66, 0x00, 0x00, 0x00
        , 0x0A, 0x49, 0x44, 0x41, 0x54, 0x08, 0x1D, 0x63, 0x60, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0xCF
        , 0xC8, 0x35, 0xE5, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82
    };

    QImage * junk = new QImage;
    if (junk->loadFromData(pixel_1x1_png, sizeof(pixel_1x1_png)))
    {
        qDebug() << "QImage ok";
    } else
        qDebug() << "QImage fails";

 

Please use plain text.