Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Sep 2008 11:02:29 -0500
From:      "Andrew Gould" <andrewlylegould@gmail.com>
To:        FreeBSD <freebsd@optiksecurite.com>
Cc:        Tom Marchand <m0rchand@comcast.net>, freebsd-questions@freebsd.org
Subject:   Re: How to compare 2 images from command line
Message-ID:  <d356c5630809020902w2f633155w571811ad844a4d1f@mail.gmail.com>
In-Reply-To: <48BD5C65.9030502@optiksecurite.com>
References:  <090220081512.17537.48BD57E100051D800000448122068246930B020E080C9DCF03@comcast.net> <48BD5A8A.5080400@optiksecurite.com> <d356c5630809020828y1e4bf347k7725857a4ceaa761@mail.gmail.com> <48BD5C65.9030502@optiksecurite.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Sep 2, 2008 at 10:31 AM, FreeBSD <freebsd@optiksecurite.com> wrote:

> Andrew Gould a =E9crit :
>
>>
>>
>> On Tue, Sep 2, 2008 at 10:23 AM, FreeBSD <freebsd@optiksecurite.com<mail=
to:
>> freebsd@optiksecurite.com>> wrote:
>>
>>    Tom Marchand a =E9crit :
>>
>>        Hash the images and compare the hashes.
>>
>>         -------------- Original message ----------------------
>>        From: FreeBSD <freebsd@optiksecurite.com
>>        <mailto:freebsd@optiksecurite.com>>
>>
>>            Hi everyone,
>>
>>            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.
>>
>>            So, my question is what are you using to determine if 2
>>            images are identical?
>>
>>            I'm using FreeBSD 7.0 and I need to be able to script this
>>            comparaison for an integration in Nagios.
>>
>>            Thank you,
>>
>>            Martin
>>
>>
>>    I just tried it and it doesn't work. The hashes are different. I can'=
t
>>    say that I'm surprised since 'diff' is "seeing" a difference between
>> the
>>    two identical images.
>>
>>
>>    Thanks for the suggestion
>>
>>
>> Yes, there's a huge difference between testing differences in images and
>> testing differences in files.  What do you mean by "...know if the displ=
ay
>> is working correctly."?
>>
>> Andrew
>>
>
> I want to determine if Mplayer is working correctly. The best way to be
> sure is to check if the display on the screen is changing. That's the
> purpose of the screenshots. The screenshots are taken by Nagios every 5
> minutes and the new screenshot is compared with the preceding one. But, b=
y
> now, it doesn't work because every tool we try is seeing a diffence betwe=
en
> 2 identical images.
>
> Thank you for your interest
>

Are you simply trying to determine whether the mplayer has finished playing
a movie (that you're not watching)?  It seems to me that the fact that the
image changes is not a good indication that mplayer is "working correctly",
only that the movie isn't running.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d356c5630809020902w2f633155w571811ad844a4d1f>