[SOLVED] libpng warning: iCCP: known incorrect sRGB profile drive me nuts

  • Qt Champions 2016

    When adding png exported from photoshop to Qrc
    and using them in the program, I get
    tons of
    libpng warning: iCCP: known incorrect sRGB profile
    libpng warning: iCCP: known incorrect sRGB profile
    (one for each file..)
    Which is pretty annoying.

    No other tool I have that reads png have an issue with these files, only libpng.
    Its photoshop 2015. Profile is correct for all tools I have that can use png profiles.

    Can I somehow disable this warning ?

  • Lifetime Qt Champion


    Looks like an image problem see this post or rather libpng that became more picky

  • Qt Champions 2016


    Well its the profile.
    "it's because libpng 1.6 does more checking of the pngs, and one or more of the png files used has an old sRGB profile"

    But how can it be old when its a photoshop 2015 ?
    No of the other tools consider the profile old.

    Its a strange warning as nothing is wrong with the profile and
    its the std one.

    Reading here

    it says
    "The feature for skipping the sRGB profile-checking was added to libpng-1.6.12"

    So is there any way I could enable that for Qt ?

  • Lifetime Qt Champion

    You'd have to rebuild the png plugin after "fixing" the sources to not do the check

  • Qt Champions 2016

    Which means I would have to have VSxxx excact version , which I do not so I am going to try the libpng forums to find out what exactly it thinks is wrong with the embedded color profile. If only it would also print the file name....

    Thank you

  • Lifetime Qt Champion

    Why ? You already have the compiler matching your Qt version, no need of more for testing the png plugin

  • Qt Champions 2016

    But my Qt Creator is compiled with VS so I assumed that compiling a new png plugin with minGW is a no go ? (as in wont work)

  • Lifetime Qt Champion

    The Qt version used for Qt Creator and the one you use for your application doesn't need to match unless you are building a Qt Creator plugin but in the case of your tests to disable this warning, you don't need to build a Qt Creator plugin.

  • Qt Champions 2016

    Ahh, now I understand you. (i think)
    So you say I can create a new png plugin
    and then load that in my application ?
    I guess I have to put it in build folder/plugins for app to load the modified one?

  • Lifetime Qt Champion

    IIRC, the plugin will be replaced directly in your Qt installation once built

  • Qt Champions 2016

    As in

    dont list PNG.

    So its not a plugin but sort of build in ?

  • Lifetime Qt Champion

    No, as in D:\Qt\5.5\MinGW\plugins\imageformats

    Don't mix the Qt you use with Qt Creator.

    PNG support is in qtbase (it's in the list on the second line of the first paragraph). But now that you mentioned it, you're right: it's builtin.

  • Qt Champions 2016

    Ahh, of cause . Creator is Vs but mingw need its own version.
    Hmm I getting blind, as I see no mention of qtbase but now i know.
    Maybe I should try it on linux where all will be gcc. (I hope)

    Thank you for your time.

  • Lifetime Qt Champion

    The Qt Gui module is in qtbase.

    But again, it has nothing to do with Qt Creator, to make your tests with pngs, you'll have to build qtbase (only qtbase, no need for the rest) so it will be a new Qt version + corresponding Kit for Qt Creator

  • Qt Champions 2016

    Ah. That way.
    Is there anywhere I can see which modules are part of what etc? like an overview.
    So qtbase.pro files must the one Im looking for.

    I assume getting the one from

    could work.

    Thank you for all the info.

  • Qt Champions 2016

    well it seems libpng follow standard and
    photoshop is not strict enough, so I just have to live with it or
    strip the profile completely.

    Error detection in some chunks has improved; in particular the iCCP chunk
    reader now does pretty complete validation of the basic format. Some bad
    profiles that were previously accepted are now rejected, in particular the
    very old broken Microsoft/HP sRGB profile. The PNG spec requirement that
    only grayscale profiles may appear in images with color type 0 or 4 and that
    even if the image only contains gray pixels, only RGB profiles may appear
    in images with color type 2, 3, or 6, is now enforced. The sRGB chunk
    is allowed to appear in images with any color type.

Log in to reply