From owner-freebsd-questions@FreeBSD.ORG Tue Sep 2 15:47:07 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5417F10656C2 for ; Tue, 2 Sep 2008 15:47:07 +0000 (UTC) (envelope-from wmoran@potentialtech.com) Received: from mail.potentialtech.com (internet.potentialtech.com [66.167.251.6]) by mx1.freebsd.org (Postfix) with ESMTP id 246F38FC1B for ; Tue, 2 Sep 2008 15:47:06 +0000 (UTC) (envelope-from wmoran@potentialtech.com) Received: from vanquish.ws.pitbpa0.priv.collaborativefusion.com (pr40.pitbpa0.pub.collaborativefusion.com [206.210.89.202]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.potentialtech.com (Postfix) with ESMTPSA id B6AE3EBC0C; Tue, 2 Sep 2008 11:47:05 -0400 (EDT) Date: Tue, 2 Sep 2008 11:46:39 -0400 From: Bill Moran To: FreeBSD Message-Id: <20080902114639.f06b082a.wmoran@potentialtech.com> In-Reply-To: <48BD5C65.9030502@optiksecurite.com> References: <090220081512.17537.48BD57E100051D800000448122068246930B020E080C9DCF03@comcast.net> <48BD5A8A.5080400@optiksecurite.com> <48BD5C65.9030502@optiksecurite.com> X-Mailer: Sylpheed 2.5.0 (GTK+ 2.12.11; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-questions@freebsd.org Subject: Re: How to compare 2 images from command line X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2008 15:47:07 -0000 In response to FreeBSD : > Andrew Gould a =E9crit : > >=20 > >=20 > > On Tue, Sep 2, 2008 at 10:23 AM, FreeBSD > > wrote: > >=20 > > Tom Marchand a =E9crit : > >=20 > > Hash the images and compare the hashes. > >=20 > > -------------- Original message ---------------------- > > From: FreeBSD > > > >=20 > > Hi everyone, > >=20 > > I'm trying to determine if 2 jpeg images are identical. The > > images are screenshots taken with scrot at different times. > > The point is to know if the display is working correctly. I > > tried to use 'diff' but without success, probably because of > > the metadata included in the image. I also tried the > > 'compare' command from imagemagick, but it produce an image > > containing the difference between the 2 images instead of > > telling me if both images are identical. > >=20 > > So, my question is what are you using to determine if 2 > > images are identical? > >=20 > > I'm using FreeBSD 7.0 and I need to be able to script this > > comparaison for an integration in Nagios. > >=20 > > Thank you, > >=20 > > Martin > >=20 > >=20 > > I just tried it and it doesn't work. The hashes are different. I ca= n't > > say that I'm surprised since 'diff' is "seeing" a difference betwee= n the > > two identical images. > >=20 > >=20 > > Thanks for the suggestion > >=20 > >=20 > > Yes, there's a huge difference between testing differences in images an= d=20 > > testing differences in files. What do you mean by "...know if the=20 > > display is working correctly."? > >=20 > > Andrew >=20 > I want to determine if Mplayer is working correctly. The best way to be=20 > sure is to check if the display on the screen is changing. That's the=20 > purpose of the screenshots. The screenshots are taken by Nagios every 5=20 > minutes and the new screenshot is compared with the preceding one. But,=20 > by now, it doesn't work because every tool we try is seeing a diffence=20 > between 2 identical images. Can you put the screenshots into some other format? As you mentioned, the jpeg format includes metadata, which might include the creation time and would cause every image to be unique from a filesystem view. For example, I don't believe bitmaps include metadata, which would cause them to be identical if the display were identical. --=20 Bill Moran http://www.potentialtech.com