I have several templates that contain a large cover image and then several side images. I would like set a minimum size or the cover image (something like 1500 x 600) and a minimum size for the side image ( maybe width of 500).
I don’t see any way of doing this in the panel. Is there a solution that I have missed?
Edit: Come to think about it, the problem with this approach (and the one suggested by @flokosiol) is that you can’t define this on a per field basis, as both options refer to the uploading process, not to selecting images in a field. The problem with the hook is that it would blow up the images, which is probably not the intended behavior.
Another option that comes to mind is to create a custom validator, similar to the size validator, but checking if file size is greater than. (not tested)
My idea was not to resize the images on upload, but just check the dimensions and otherwise throw an error. Of course you need to check the smallest dimensions used for the whole page (page type). Might not be the best solution …
Personally, I would only use panel.page.update hook to check select images in combination with the great gallery field plugin by @timoetting to select the side images and the default image field to select the cover image.
Thank you for the suggestions. I agree that a hook will probably not be the best solution since it does not return anything. I will look into the custom validator option and see if I can get that to work.