Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
efficient way to compare 2 images?
#24
This worked for me. I made a copy of an instagram icon and changed the name. I compared the original to the one with the changed name to see if the name change would affect the results. It did not. This is a very fast method, but sure, you'd have to look into any particulars that it might not be reliable.

For now, if you are curious, here is how it's done.

Code: (Select All)
IF _FILEEXISTS("instagram_icon.jpg") THEN
    OPEN "instagram_icon.jpg" FOR BINARY AS #1
    a$ = SPACE$(LOF(1))
    GET #1, , a$
    CLOSE #1
    PRINT LEN(a$)
END IF

IF _FILEEXISTS("junk-for-qb64-test.jpg") THEN ' This is a renamed copy of the instigram icon.
    OPEN "junk-for-qb64-test.jpg" FOR BINARY AS #1
    b$ = SPACE$(LOF(1))
    GET #1, , b$
    CLOSE #1
    PRINT LEN(b$)
END IF

IF LEN(a$) AND LEN(b$) THEN
    IF a$ = b$ THEN PRINT "Same Image" ELSE PRINT "Different Image"
ELSE
    PRINT "An image couldn't be found."
END IF

Pete
Shoot first and shoot people who ask questions, later.
Reply


Messages In This Thread
efficient way to compare 2 images? - by madscijr - 11-18-2022, 07:51 PM
RE: efficient way to compare 2 images? - by bplus - 11-18-2022, 08:10 PM
RE: efficient way to compare 2 images? - by Pete - 11-18-2022, 08:26 PM
RE: efficient way to compare 2 images? - by Pete - 11-18-2022, 08:55 PM
RE: efficient way to compare 2 images? - by Pete - 11-18-2022, 09:30 PM
RE: efficient way to compare 2 images? - by Pete - 11-18-2022, 09:52 PM
RE: efficient way to compare 2 images? - by Pete - 11-18-2022, 11:08 PM
RE: efficient way to compare 2 images? - by bplus - 11-18-2022, 11:40 PM
RE: efficient way to compare 2 images? - by bplus - 11-19-2022, 12:22 AM
RE: efficient way to compare 2 images? - by bplus - 11-19-2022, 01:22 AM
RE: efficient way to compare 2 images? - by bplus - 11-19-2022, 05:39 PM
RE: efficient way to compare 2 images? - by bplus - 11-19-2022, 06:28 PM
RE: efficient way to compare 2 images? - by bplus - 11-19-2022, 10:54 PM
RE: efficient way to compare 2 images? - by bplus - 11-19-2022, 11:54 PM
RE: efficient way to compare 2 images? - by bplus - 11-19-2022, 11:57 PM
RE: efficient way to compare 2 images? - by bplus - 11-20-2022, 12:02 AM
RE: efficient way to compare 2 images? - by bplus - 11-20-2022, 12:14 AM
RE: efficient way to compare 2 images? - by bplus - 11-20-2022, 12:36 AM
RE: efficient way to compare 2 images? - by bplus - 11-20-2022, 02:37 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  about Hardware Images and _DisplayOrder,Help! qbfans 11 575 02-11-2026, 07:10 AM
Last Post: SMcNeill
  Nth problem with hardware images Ikerkaz 9 506 01-23-2026, 02:58 PM
Last Post: bplus
  Hardware images questions Dav 5 478 12-04-2025, 04:18 PM
Last Post: Pete
  Hardware images...Talk to me! Unseen Machine 5 746 09-22-2025, 11:12 PM
Last Post: TempodiBasic
  Transparency with Hardware Images NakedApe 8 1,039 07-10-2025, 09:47 AM
Last Post: Pete

Forum Jump:


Users browsing this thread: 1 Guest(s)