X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=scripts%2Fpnmtologo.c;h=68bb4efc5af429a2f5d1ec359a06d3f2e7af8bb4;hb=cfe68642cff7c121f38a088a795759fd3500122c;hp=5c113123ed9f208840d5af7283e6df4769a4bc12;hpb=dede17b8e931eeaa38b0288e8d545d558d904942;p=karo-tx-linux.git diff --git a/scripts/pnmtologo.c b/scripts/pnmtologo.c index 5c113123ed9f..68bb4efc5af4 100644 --- a/scripts/pnmtologo.c +++ b/scripts/pnmtologo.c @@ -74,6 +74,7 @@ static unsigned int logo_height; static struct color **logo_data; static struct color logo_clut[MAX_LINUX_LOGO_COLORS]; static unsigned int logo_clutsize; +static int is_plain_pbm = 0; static void die(const char *fmt, ...) __attribute__ ((noreturn)) __attribute ((format (printf, 1, 2))); @@ -103,6 +104,11 @@ static unsigned int get_number(FILE *fp) val = 0; while (isdigit(c)) { val = 10*val+c-'0'; + /* some PBM are 'broken'; GiMP for example exports a PBM without space + * between the digits. This is Ok cause we know a PBM can only have a '1' + * or a '0' for the digit. */ + if (is_plain_pbm) + break; c = fgetc(fp); if (c == EOF) die("%s: end of file\n", filename); @@ -167,6 +173,7 @@ static void read_image(void) switch (magic) { case '1': /* Plain PBM */ + is_plain_pbm = 1; for (i = 0; i < logo_height; i++) for (j = 0; j < logo_width; j++) logo_data[i][j].red = logo_data[i][j].green =