PNG warning: iCCP: known incorrect sRGB profile

Post Reply
PenguinDad
Member
Posts: 122
Joined: Wed Apr 10, 2013 16:46

PNG warning: iCCP: known incorrect sRGB profile

by PenguinDad » Post

Everytime I play minetest I'm getting this warning "PNG warning: iCCP: known incorrect sRGB profile"
Does anybody know more about it?
Paste: http://pastebin.com/4z0jYmqA

sfan5
Moderator
Posts: 4094
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

by sfan5 » Post

You can safely ignore this.
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

PenguinDad
Member
Posts: 122
Joined: Wed Apr 10, 2013 16:46

by PenguinDad » Post

Thank you.

cy
Member
Posts: 66
Joined: Sun Jun 24, 2012 17:25

Re: PNG warning: iCCP: known incorrect sRGB profile

by cy » Post

Huh, been a while.
From here I saw the advice:

Code: Select all

pngcrush -ow -rem allb -reduce file.png
  • ow will overwrite the input file
  • rem allb will remove all ancillary chunks except tRNS and gAMA
  • reduce does lossless color-type or bit-depth reduction
That will of course change the hash of every .png file it's used on, so you'll probably want a new git commit for each mod. I think "-n" instead of "-ow" will just print the messages instead, so you could parse that output somehow to find which files to change. Any .png files changed would probably have to be pushed to the upstream repository, before the rest of us could benefit from not flooding our console log with hundreds and hundreds of libpng warnings that don't even say which .png file is causing it.

cy
Member
Posts: 66
Joined: Sun Jun 24, 2012 17:25

Re: PNG warning: iCCP: known incorrect sRGB profile

by cy » Post

This fixed it:

Code: Select all

#include <stdio.h>
#include <stdlib.h> // free

/*
  $ find -name '*.png' | while read filename; do pngcrush -q -n -rem allb -reduce $filename |& grep -v ^CPU | grep -v 'Total length' | tee badpngs.log
  $ ./thisprogram < badpngs.log | while read filename; do pngcrush -ow -rem allb -reduce $filename; done
*/

//#define DEBUGGINGCRAP

int main(void)
{
	char* line = NULL;
	size_t space = 0;
	char* filename = NULL;
	size_t fnlen = 0;
	for(;;) {
		ssize_t amt = getline(&line, &space, stdin);
		if(amt <= 0) break;
		if(line[amt-1] == '\n') {
			--amt;
			if(amt == 0) continue;
		}
		if(line[0] == ' ' && line[1] == ' ') {
			if(filename) free(filename - 2);
			filename = line + 2; /* 2 leading spaces */
			fnlen = amt - 3;	 /* trailing colon, space, newline? */
			line = NULL;
			space = 0;
			continue;
		}
		if(filename == NULL) {
			printf("BAD LOG %s", line);
			continue;
		}
#ifdef DEBUGGINGCRAP
		printf("filename: %.*s\nerror: %.*s\n", (int)fnlen, filename,

			   (int)amt, line);
#else
		fwrite(filename, fnlen, 1, stdout);
		fputc('\n', stdout);
#endif
	}
	free(line);

    return 0;
}

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests