Solved by ptrmcl in post #12 
              
              
                General advice, look at the docs! This will answer most of your questions. For example, here, it says that if you pass in a single parameter, it will resize the shortest side of the image to that (and maintain the aspect ratio). 
First thing I would do though is to make sure you understand the basic…