Is there a way when uploading images (JPEG) to check the DPI?
I would like to integrate it into a form, so as a validator.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You have to open the image with Imagick (or Gmagick) and then call
getImageResolution.result:
Edit:
For an integration into symfony, you can use a custom validator for that. You extends the default one to validate a file and add the DPI restriction.
Create this one into
/lib/validator/myCustomValidatorFile .class.php:Then, inside your form, use this validator for your file: