When uploading your product images, it is recommended to simply upload the largest images you have. Shopify will resize this image to various smaller sizes that will be used throughout your shop. Both landscape and portrait images are supported in all of our themes.
If your product images have different dimensions then they may appear misaligned on the collection page. You can go to the Theme Settings > Collection Page section and select 'align product rows'. This will set the height of all of your images so they appear aligned in each row.
If you choose to edit the template files, you can reference the proper format for controlling product image sizes in the Shopify Help Center .