[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 206
  • Last Modified:

JPGE Images

Hi Experts,

Could anybody tell me how to check if two Images are identically or not? (JPGE )

k4hvd
0
k4hvd77
Asked:
k4hvd77
  • 3
  • 2
1 Solution
 
Ivanov_GCommented:

   uses
      jpeg;

   var
     jpg_file : TJpegImage;

   load the JPG image in this JpegImage and the convert to Bitmap using Bitmap.Assign(JPG_file) method. Now you have 2 Bitmaps which have Canvas propery and you can compare them.

    The other way is to compare the size, the headers, etc. but this don't guarantee you anything.
0
 
mbprogrammerCommented:
There are many algorithms for this purpos. it depends on your destination
(I mean your app usage) some of them compares RGB colors. it's a fast and trustable method. they compared the amount of each color not the pixeles and not the position of them. they also after getting the ture result from this test , they will test a little amount of pixels and their positions.
0
 
k4hvd77Author Commented:
mbprogrammer,
I need a fast method! Could you post some codes how to do theat?


k4hvd77
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
mbprogrammerCommented:
this is a very simple and easy way to check the equality of two icons. you can change it for bmps.

function IconsAreEqual(const Icon1, Icon2: TIcon): Boolean;
var
  ms1: TMemoryStream;
  ms2: TMemoryStream;
begin
  Result := False;
  ms1    := TMemoryStream.Create;
  try
    Icon1.SaveToStream(ms1);
    ms2 := TMemoryStream.Create;
    try
      Icon2.SaveToStream(ms2);
      if ms1.Size = ms2.Size then
        // Compare the streams, Streams vergleichen:
        Result := CompareMem(ms1.Memory, ms2.Memory, ms1.Size)
      finally
        ms2.Free
    end
  finally
    ms1.Free
  end
end;

for better algorithms codes, you should search , I cann't help you now, I have many works to do (sorry) ;)
0
 
mbprogrammerCommented:
have a look at here is good : http://www.catenary.com/howto/comparator.html
0
 
k4hvd77Author Commented:
thank you mbprogrammer ;)


k4hvd77
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now