efficient way to compare 2 images?
#16
Code: (Select All)
Option Explicit
$NoPrefix
$Console:Only

Dim As String file1, file2, hash1, hash2

file1 = "C:\Users\zspriggs\Documents\QB64\qb64pe.exe"
'file2 = "C:\Users\zspriggs\Documents\QB64\pipecomqb64.bas"
file2 = file1 'You can comment this line and uncomment the one above. Obviously, you'll replace the paths with ones you have.


hash1 = GetHash(file1)
hash2 = GetHash(file2)

If hash1 = hash2 Then Print "Same" Else Print "Different"


Function GetHash$ (filename As String)
    Dim As String filecopy: filecopy = "\" + Chr$(34) + filename + "\" + Chr$(34)
    GetHash = pipecom_lite("PowerShell -NoProfile Get-FileHash -Path " + filecopy + " ^| foreach {$_.Hash}")
End Function

'$Include:'pipecomqb64.bas'
This might work for ya.


Attached Files
.bas   pipecomqb64.bas (Size: 8.84 KB / Downloads: 79)
Ask me about Windows API and maybe some Linux stuff
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 SpriggsySpriggs - 11-18-2022, 09:27 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



Users browsing this thread: 22 Guest(s)