Allow only specified file resolution on image uploader

I am looking for a way to restrict my site users from uploading any other image resolution other than the specified image resolution. e.g. Only image resolution of 2000x2000px allowed, anything less or more not allowed.

Is there a way to do this?

I am not very familiar with image resolution and how that affects the size but I do know it is about ratio

2000x2000px is a ration of 1:1

If you want this functionality for the purposes of restricting the ratio so that when displaying the images using an image element on page that is set to dimensions equal to a 1:1 ratio, you can use the croppie plugin to crop images to a specified ratio.

If you are concerned about the image file size, the croppie plugin and other uploaders allow you to set the max file size allowed for file storage management…so if image file is greater than 2MB you can restrict it from getting uploaded.

As far as I am aware from my research on image file size, dimensions, ratios etc. the value of 2000x2000px is really just about the size and nothing to do with image quality…therefore it is more about a ration of 1:1 , so I am under the understanding that 2000x2000px is the same as 150x150px from a ratio perspective. The difference is the 2000x2000px will be a larger file size in terms of MB and therefore affecting the storage of image files.

Also, think about your users…do you really want to make life so difficult for them by requiring 2000x2000px and nothing else? People with smaller files will need to find a way to increase the size and therefore lower their image quality, and others will need to find a way to decrease the size, both of which would be reasons to abandon the app.

My approach might not be the correct approach for everybody, but I use the croppie plugin to limit the file size ( storage costs money ) and to force the user to crop an image to the ratio I use for display. My product images are ratio 1:1 because I display them in a square. Business location images such as hotel rooms are aspect ratio of 2:3 because I display them as a kind of banner image…other than that it doesn’t matter from my point of view what their original image pixel dimensions are.

I need higher resolution for a purpose. My platform requires artists to upload art files which is then required for custom printing purposes for them to sell products. I cant have smaller files with low quality etc also for products to be printed properly, I need a the specified resolution mandatory.

Its not for the purpose of maintaining a specific ratio as such.

I’d have a look through the plugins currently available for images. I think most are only able to provide size information.

If no plugin is currently available, I’m sure you’d be able to find somebody to build a plugin for you.

You could always upload the image/file and add a condition in the workflow to check dimensions. If the dimensions don’t match, then have it delete the file and show a message to the user stating image size is incorrect.

1 Like

is there a check dimensions option available ?

This topic was automatically closed after 70 days. New replies are no longer allowed.