Custom property with Medialibrary
I'm trying to work out how to store a custom property with uploaded images to say whether it is landscape, portrait, or square. I was planning on dividing the width by the height and if the result < 0.75 = landscape, result > 1.25 = portrait, otherwise square. But how can I make those calculation on the uploaded image before it is stored in the database?