0

I have some 300,000 images which I need to browse through to find out corrupt images. By corrupt I have to explain what the problem:

Some of the images have a particular part of the image showing this issue. I dont know what to call it and hence could find a solution either.

Matt Ball
  • 354,903
  • 100
  • 647
  • 710
Parag Paul
  • 51
  • 7

2 Answers2

1

I agree with the comment by Mitch that it's a requirements description, because I don't think it's a known issue and I also never saw it before. You're probably going to have to find a way to detect those images yourself.

(It's not like red eyes in a picture, that you could just pick up a tool and fix it right away).

You can start with creating a Bitmap object with Bitmap(String) constructor, which accepts the path to the file.

You can read the pixels using Bitmap.GetPixel(Int32, Int32) to detect those images (you're going to have to come up with an algorithm of some sort to do that though. Perhaps read the bottom rows and see if it consists only the two colors that are in your image (that brown and yellow) EDIT: I've just viewed the image with zoom, and it probably won't work as simple as that because the image has anti-aliasing. But you can check if most of the pixels are in those colors, that should work).

Side note:

Now, if you want to actually edit them (if you have the rest of the image in a different file, for example) you can create a Graphics object using the static method Graphics.FromImage(Image). Warning: Graphics Objects are disposable. Don't forget to dispose them after you're saving the file or just done modifying the graphics.

MasterMastic
  • 20,711
  • 12
  • 68
  • 90
  • I was wondering whether in the world of heavy image handling, these are known issues that happen when there is rescaling or copying. If yes, are there standard algorithms that would catch them . If not, I will have to write them on my own – Parag Paul Mar 21 '13 at 21:00
  • @Rahiakil I figured so, but unfortunately I don't really take part in that world so I'm not sure, but my assumption is that it's not a well known issue. – MasterMastic Mar 22 '13 at 08:13
0

There is code to detect corrupted images in this question

The real question is how did these images become corrupted? If you have failing disks or other hardware on the machine they are stored, that needs to be addressed as well.

Community
  • 1
  • 1
Bert
  • 2,134
  • 19
  • 19