Image size restrictions

Currently, you can limit the maximum dimensions for various image derivatives in the admin side of the site. However, you cannot specify if you want the dimensions to apply to length or width.

On the item/show pages of our site we have a horizontal space of 500px for our images. We have set the fullsize derivative to 500px. This works for resizing landscape pictures for that space, but not portrait pictures. The height of these pictures gets set to 500px, and the width is usually much smaller than the 500px space. After uploading pictures, we manually go through and replace the portrait pictures with ones that have a width of 500px.

Is there any way to limit derivative images size by a specific dimension?

In theory, it seems possible. (Yeah, a response that begins with "in theory" might not be that reassuring, but here we go!). A plugin that makes use of the after_file_upload hook should be able to tap into the mechanisms for creating derivative images. I've never done this myself, though, so I can't offer direct tips. But, it looks like, starting with that hook, and looking at the file /application/libraries/Omeka/File/Derivative/Image.php, especially the methods createImage() and createDerivativeImages(), might point in the right direction.