Ability to restrict image sizes for a single upload field #2083
Replies: 2 comments
-
I'd like to add to this suggestion also the ability to specify mime types also. |
Beta Was this translation helpful? Give feedback.
-
Oh man. I really would like this now. Will wait to v3 is out but this seems like critical field level controls. I'm thinking a CMS like WordPress where we have a centralized Media collection that can have some global controls and format is great. But there should be field level overrides like I can do with ACF etc. I think of a use case like me as a dev wanting to make it as fool proof for my content editors. I'm reading around trying to figure out how to support being able to leave my media collection un assuming as possible and then trying to validate image sizes on the field level with hooks or the validate method. I'm not to a solution yet but it really should be easy easy as options on the upload field config in the end. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have seen other CMS tools with functionality that allow you to restrict images being uploaded to be a certain size.
E.g. this could be for a home page slider where the image needs to be 1500x1000 pixels.
I understand payload allows any image sizes to be uploaded and they are auto-resized based on the Media component. What would happen however if an image was uploaded smaller than 1500x1000 pixels? Would it be upscaled to that size?
Ideally, I would like the functionality to be able to specify the upload size on the upload component itself. Example below.
If an image was uploaded that did not meet that height and width, it would fail and show the user an error message.
Beta Was this translation helpful? Give feedback.
All reactions