From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mimir.eigenstate.org ([206.124.132.107]) by ewsd; Fri Aug 21 14:47:36 EDT 2020 Received: from abbatoir.fios-router.home (pool-74-101-2-6.nycmny.fios.verizon.net [74.101.2.6]) by mimir.eigenstate.org (OpenSMTPD) with ESMTPSA id b36cf05b (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO) for <9front@9front.org>; Fri, 21 Aug 2020 11:47:27 -0700 (PDT) Message-ID: <253CC91A3D00087821A92B6D43237A44@eigenstate.org> To: 9front@9front.org Subject: Re: [9front] minor bug report: png spews Date: Fri, 21 Aug 2020 11:47:26 -0700 From: ori@eigenstate.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: engine dependency control > looks like it's just a forgotten debug print because it only occurs with -9. oddly, there are rather a lot of lines computing just for that message. > > here's a patch, tested minimally. let me know if you want a different format; this is diff -c. > > png.c.0:132,138 - png.c:132,137 > Rawimage **array, *r, *c; > Image *i, *i2; > int j, ch, outchan; > - long len; > Biobuf b; > char buf[32]; > static int inited; > png.c.0:207,230 - png.c:206,211 > } > if(nineflag){ > chantostr(buf, outchan); > - len = (c->r.max.x - c->r.min.x) * (c->r.max.y - c->r.min.y); > - switch(c->chandesc){ > - case CY: > - // len *= 1; > - break; > - case CYA16: > - len *= 2; > - break; > - case CRGB24: > - len *= 3; > - break; > - case CRGBA32: > - len *= 4; > - break; > - } > - if(c->chanlen != len) > - fprint(2, "%s: writing %d bytes for len %ld chan %s\n", > - argv0, c->chanlen, len, buf); > print("%11s %11d %11d %11d %11d ", buf, > c->r.min.x, c->r.min.y, c->r.max.x, c->r.max.y); > if(write(1, c->chans[0], c->chanlen) != c->chanlen){ Hm. Does this happen on all PNG images? If not, do you have an example image that triggers it? I haven't tested yet, but it looks like it's warning about a possible miscomputation of image size.