in reply to Re: Fast way to compare two picture-files
in thread Fast way to compare two picture-files

Depending on what the OP is asking for, checking the first 16K of the file won't provide the correct answer if a) the OP is trying to determine are the images the same (rather than just are the files identical) and b) the files are in different formats (say, JPG and BMP) but are actually the same image.

Update Oops -- ikegami is quite right, the loop checks the entire file, not just the first 16K.

Alex / talexb / Toronto

"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

  • Comment on Re^2: Fast way to compare two picture-files

Replies are listed 'Best First'.
Re^3: Fast way to compare two picture-files
by ikegami (Patriarch) on Dec 29, 2008 at 09:10 UTC

    The code checks the entire file (not just the first 16K). "for (;;)" can be read as "for ever". And the post already says the code compares files not images.