how to detect bad photos using asp.net c#
(at the time of picture upload)
please help me... urgent.... please help
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Mohamed AbedallahRank #2,074 · 697 reputationPosted Jun 15, 2017, 7:07 AM EDT
Do you mean a user might upload a file that's not a valid image at all? If yes, the code to detect such a file would be:
Leadtools.Codecs.RasterCodecs codecs = new Leadtools.Codecs.RasterCodecs();
try
{
Leadtools.Codecs.CodecsImageInfo info = codecs.GetInformation(fileName, false);
}
catch (Exception ex)
{
//Console.WriteLine("problem with image file " + ex.Message);
}
If you mean you want to detect images that have too much red tone in them, this will only work if all your images are for the same subject. This means are the images coming from a production line in a factory, where all the photos will have the same lighting and same object being photographed?
If not, how can you tell the red tone is not really part of the "good" image? For example, if a person shoots a photo of a red rose up close, it will mostly be red, but it might not be "bad".
Harikrishnan Vg35 reputationPosted Jun 15, 2017, 3:32 AM EDT
Manikandan MurugesanRank #300 · 8.4K reputationPosted Jun 15, 2017, 4:39 AM EDT
Rajkiran SwainRank #165 · 14.4K reputationPosted Jun 15, 2017, 6:25 AM EDT