From owner-cvs-ports@FreeBSD.ORG Mon Mar 29 10:50:03 2010 Return-Path: Delivered-To: cvs-ports@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84437106564A; Mon, 29 Mar 2010 10:50:02 +0000 (UTC) (envelope-from itetcu@FreeBSD.org) Received: from worf.ds9.tecnik93.com (worf.ds9.tecnik93.com [81.196.207.130]) by mx1.freebsd.org (Postfix) with ESMTP id A5E068FC14; Mon, 29 Mar 2010 10:50:01 +0000 (UTC) Received: from it.buh.tecnik93.com (it.buh.tecnik93.com [81.196.204.98]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by worf.ds9.tecnik93.com (Postfix) with ESMTPSA id 85FA322C50A6; Mon, 29 Mar 2010 13:50:00 +0300 (EEST) Date: Mon, 29 Mar 2010 13:49:59 +0300 From: Ion-Mihai Tetcu To: Dominic Fandrey Message-ID: <20100329134959.18bf2919@it.buh.tecnik93.com> In-Reply-To: <4BB07D0F.4090604@bsdforen.de> References: <201003290931.o2T9VrXu030819@repoman.freebsd.org> <4BB07D0F.4090604@bsdforen.de> X-Mailer: Claws Mail 3.7.5 (GTK+ 2.18.7; amd64-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/_M=DFoqn0w0USnPIof8+8i+"; protocol="application/pgp-signature" Cc: Dirk Meyer , cvs-ports@FreeBSD.org, cvs-all@FreeBSD.org, ports-committers@FreeBSD.org Subject: Re: cvs commit: ports/graphics/imlib2 Makefile ports/graphics/imlib2/files patch-loader_png.c X-BeenThere: cvs-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 10:50:03 -0000 --Sig_/_M=DFoqn0w0USnPIof8+8i+ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Mon, 29 Mar 2010 12:12:31 +0200 Dominic Fandrey wrote: > On 29/03/2010 11:31, Dirk Meyer wrote: > > dinoex 2010-03-29 09:31:53 UTC > >=20 > > FreeBSD ports repository > >=20 > > Modified files: > > graphics/imlib2 Makefile=20 > > graphics/imlib2/files patch-loader_png.c=20 > > Log: > > - fix code for png-1.4.1 > > =20 > > Revision Changes Path > > 1.136 +1 -1 ports/graphics/imlib2/Makefile > > 1.3 +1 -1 ports/graphics/imlib2/files/patch-loader_png.c >=20 > Why did you rebreak imlib2? >=20 Trouble is this is the correct code, according to png developers: libpng-1.4.1/CHANGES: Changed png_check_sig() to !png_sig_cmp() in contrib= programs. Libpng provides a simple check to see if a file is a PNG file. To use it, pass in the first 1 to 8 bytes of the file to the function png_sig_cmp(), and it will return 0 (false) if the bytes match the corresponding bytes of the PNG signature, or nonzero (true) otherwise. Of course, the more bytes you pass in, the greater the accuracy of the prediction. FILE *fp =3D fopen(file_name, "rb"); if (!fp) { return (ERROR); } fread(header, 1, number, fp); is_png =3D !png_sig_cmp(header, 0, number); if (!is_png) { return (NOT_PNG); } --=20 IOnut - Un^d^dregistered ;) FreeBSD "user" "Intellectual Property" is nowhere near as valuable as "Intellect" FreeBSD committer -> itetcu@FreeBSD.org, PGP Key ID 057E9F8B493A297B --Sig_/_M=DFoqn0w0USnPIof8+8i+ Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkuwhdcACgkQJ7GIuiH/oeWJjwCfbXRRqNOEXRcyn7xsgFp15jXT cQEAnjqj7klQmmEZ18lqsASvEwdj37DT =4vJP -----END PGP SIGNATURE----- --Sig_/_M=DFoqn0w0USnPIof8+8i+--