i would like to ask is it possible to allow the user to upload images of certain category for eg. only pictures with animals are allowed to be uploaded. Does it count as a validation?
Asked
Active
Viewed 39 times
-2
-
Validation probably but you would need some sort of image recognition software to process the uploaded images. For example the [Google Vision API](https://cloud.google.com/vision/) – empiric Jan 16 '18 at 08:48
-
mmh, yes and no? It's a kind of validation, but this would rather happen on server-side, to avoid a big image recognition module to be included to the client side logic – Kaddath Jan 16 '18 at 08:48
-
Question has absolutely nothing to do with the jQuery Validate plugin so I'm removing that tag. Please be mindful of tag-spam. – Sparky Jan 16 '18 at 16:14
-
Please review the FAQ about what you are allowed to ask: https://stackoverflow.com/help/on-topic – Sparky Jan 16 '18 at 16:16
-
Maybe my comnent is out of topic, but I have seen ReCaptcha validating like pictures with signBoard and with trees etc. It could be static in image or dynamic validation – SSD Jan 16 '18 at 16:22
-
Yes i would like to do something similar like that – Eddie Lee Jan 17 '18 at 09:51
2 Answers
0
Yes, I guess you could call it validation. However, detecting whether or not a picture is an animal is not simple by any means. It's only possible now due to decades of research. So, possible? yes. Easy? definitely not.

EKW
- 2,059
- 14
- 24
-
Yeah i know its not easy therefore i would like to hear what the experts opinion are. Because im allowing the user to upload an image, however i would not like them to upload rubbish into the database. Is there any alternatives to this? – Eddie Lee Jan 16 '18 at 09:06
-
You could use the Google Vision API (or some other computer vision API) as @empiric suggested. Other than that, there's really not much you can do. – EKW Jan 16 '18 at 09:21
0
You can't check the category of the picture.. When users load picture in your website, you can't programmaly check what catagory of picture is.
However, you can verify title of img.
You can try to implement a recognize service ( like amazon AWS ) to send the picture and get description to check user upload, but it's not faster...

Léo R.
- 2,620
- 1
- 10
- 22
-
So i peobably need a recognise service/software and implement it? How about now allowing the user to upload duplicate images? – Eddie Lee Jan 16 '18 at 09:04
-
if you really want to verify category of picture, yes you need a recognise service, but if you want to check duplicate img, you can convert picture in base64 and compare 2 Base64 img – Léo R. Jan 16 '18 at 09:09
-
-
https://stackoverflow.com/questions/22172604/convert-image-url-to-base64 – Léo R. Jan 16 '18 at 09:24