andreikop / enki

A text editor for programmers
http://enki-editor.org
GNU General Public License v2.0
161 stars 39 forks source link

libpng warning #398

Closed bjones1 closed 8 years ago

bjones1 commented 8 years ago

A minor nitpick: I get two warnings "libpng warning: iCCP: known incorrect sRGB profile" when I run on Windows. I'm not sure which PNG it's complaining about, though...

andreikop commented 8 years ago

I've also seen this. And it seems like some internal Qt <->libpng problem. Let's just ignore it

bjones1 commented 8 years ago

Looking a bit (those errors bother me), I wrote:

# This simple program loads all images it can find, hoping to produce ``libpng warning: iCCP: known incorrect sRGB profile`` warnings.
#
import os
from os.path import splitext
import time
import sys
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import QApplication, QLabel, QDialog

app = QApplication(sys.argv)
for (dirpath, dirnames, filenames) in os.walk('.'):
    for f in filenames:
        if splitext(f)[1] in ('.png', '.jpg', '.jpeg'):
            path = os.path.join(dirpath, f)
            print('\nLoading {}... '.format(path), end='', file=sys.stderr)
            sys.stderr.flush()
            p = QPixmap(path)

Output from python find_bad_images.py 2> err.txt && type err.txt | find "libpng":

Loading .\icons\search.png... libpng warning: iCCP: known incorrect sRGB profile
Loading .\icons\settings.png... libpng warning: iCCP: known incorrect sRGB profile
Loading .\icons\languages\d.png... libpng warning: iCCP: known incorrect sRGB profile
Loading .\icons\_old\EditorBookmark0.png... libpng warning: iCCP: known incorrect sRGB profile
Loading .\icons\_old\EditorBookmark1.png... libpng warning: iCCP: known incorrect sRGB profile
Loading .\icons\_old\EditorBookmark2.png... libpng warning: iCCP: known incorrect sRGB profile
Loading .\icons\_old\EditorBookmark3.png... libpng warning: iCCP: known incorrect sRGB profile
Loading .\icons\_old\EditorBookmark4.png... libpng warning: iCCP: known incorrect sRGB profile
Loading .\icons\_old\EditorBookmark5.png... libpng warning: iCCP: known incorrect sRGB profile
Loading .\icons\_old\EditorBookmark6.png... libpng warning: iCCP: known incorrect sRGB profile
Loading .\icons\_old\EditorBookmark7.png... libpng warning: iCCP: known incorrect sRGB profile
Loading .\icons\_old\EditorBookmark8.png... libpng warning: iCCP: known incorrect sRGB profile
Loading .\icons\_old\EditorBookmark9.png... libpng warning: iCCP: known incorrect sRGB profile
Loading .\icons\_old\todo.png... libpng warning: iCCP: known incorrect sRGB profile
bjones1 commented 8 years ago

I fixed the warnings using ImageMagik -- the command was mogrify <name>.png to get rid of libpng warning: iCCP: known incorrect sRGB profile. See http://stackoverflow.com/questions/22745076/libpng-warning-iccp-known-incorrect-srgb-profile.

Rather than fix images in _old, I deleted them.

andreikop commented 8 years ago

Excellent! Where is the commit?

bjones1 commented 8 years ago

I just pushed it. I haven't booted up Linux to run generate-icons-resource.sh yet, though. Would you mind doing this if you have a minute?

andreikop commented 8 years ago

Done!

bjones1 commented 8 years ago

Thanks!