Hello. When adding a product I crop a photo. I use the library SimpleImage.php Instructions for the library here

 $img_test = new abeautifulsite\SimpleImage($uploadfile); $img_test->thumbnail(270, 180); $img_test->save($uploadthumb); 

But there is one unpleasant moment. If you take absolutely any photo, such as a square 800 by 800, then it creates a thumb sized 270 by 180, but at the same time it cuts off some of the top photo. How do you get out of this situation? How to properly create thumb photo for online store?

  • How do you want to get a rectangular thumbnail from a square image and not to cut something off? - Visman
  • Well, Tipo as in instagram. Instagram when publishing photos converts rectangular images into square. And he does not just cut them, but complements the edges with a white background to make a square photo. - duddeniska
  • This library apparently does not have such a function. - Visman

0