0

I'm developing a user registration form with an optional photo upload feature. I'd like to check if the photo upload exceeds a limit on dimensions.

Is it possible to do this with Javascript?

Kalnode
  • 9,386
  • 3
  • 34
  • 62
  • Possible duplicate of [How to Preview Image, get file size, image height and width before upload?](https://stackoverflow.com/questions/12570834/how-to-preview-image-get-file-size-image-height-and-width-before-upload) – jAC Jan 17 '18 at 10:48
  • @jAC It depends on whether he wants a server or client side read. Reading the image dimensions on server side is possible by getting the image contents into the memory buffer and reading the certain hex values of the header. It is not trivial. There are also libraries and modules available that can do it for you. However, I don't want to answer the question, given the lack of OP effort in the issue. SO is not a place, where one can expect others to do their job for them, as Sean Francis pointed out. – Alexander Jan 18 '18 at 05:17
  • @Alexander I agree, but since he states Javascript and "can't submit form", I'm pretty sure he's talking about client side verification. – jAC Jan 18 '18 at 07:36

0 Answers0