I'm going to make some assumptions
1. You are comparing a single image with a number of images.
2. The comparison is a byte-to-byte comparison of two images.
3. Images are in the same format.
Then
foreach image in database
{
images_equal = true
if ( image.Size != uploaded_image.Size )
{
images_equal = false
}
else
{
foreach byte in the images
{
if ( image_byte != uploaded_image_byte )
{
images_equal = false
break
}
}
}
if ( images_equal )
{
do something with equal images
}
else
{
do something with unequal images
}
}
The byte to byte comparison may require System.Runtime.InteropServices.