Why cropping images on product_image?

Why product_image is cropping the images?
I do not see any case where this could be a feature as default behavior. All products and images are diverse width and height.
Tryton always should contain the true data of the company, not an altered cropped version.
If the problem is that in a website it should be rendered in equal dimensions, it can be addressed with css or with some method on images that generate a cache with custom dimensions.

Also, this behavior is not documented on docs:

The images are stored as `JPEGs <https://en.wikipedia.org/wiki/JPEG>`_ format
and with a maximal horizontal and vertical size of 2048 pixels.

I propose to remove the crop and use size of the _resize as width to return image based on a ratio from the original.

1 Like

I’m wondering also if the 2048 max restriction is correct as required or should be only a default value allowing to be deactivated. For example, for high detailed images like blueprint plans. So why limiting to 2048 if screen market is growing on usage of more pixels (4k screens on most industrial - engineering laptops)?

To standardize format. And the square format is the most common because it is the more flexible for designer.

Because this will make the website perform very badly.

I have seen any webshop platform allowing more.

It makes no sense to store blueprint plans as JPG image.

But more of the ecommerce is done on mobile.

Thanks for your answer, but most of the responses provided are assuming product_image is only used for ecommerce/webshop.
There also can be internal tooling platforms where this big images are needed, and as the name suggest, this module should be valid for product and not only for ecommerce usages.

What about books? Sofas? Films? They have their own ratio. Try to upload a book cover as image and you will see that most times (depending on the book), the title and author is half cropped. A shop for jewelry, It’s not normal to crop the same for a ring photo and a necklace on the center of the image. The necklace most important part is on the bottom.
I can understand the standardize need but I think the best is to find some solution to cover all use cases, so:
I propose to allow some image configuration to toggle cropping and if so, define the ratio or size desired.
Normally for the designer, the box where the image goes is standard and they have to find the best way to display it depending on the use case.

for example,

  • Instagram post grid is square but when you open the image is in another ratio.
  • Pinterest grid is equal in width but flexible in height

But it’s leaving great usage cases for the product_image outside.

1 Like

The point is standardisation. If you do not want that, use something else.

You are reducing the functionality of a module to a simple cropping function. What about the thumbnails, the cache and resizes also.

I want this standardisation sometimes, If I sell books I want to display in the ecommerce all the book cover, take a look on any book ecommerce, so the original size should be maintained. I love the resize option to optimize for web but maintaining the ratio.

Why are you against of making the module more generic and available for more use cases, while maintain the same functions?
This also makes the company have the same photos on the company disk (original) and on Tryton.

1 Like

Then why not making it configurable?

Yes they all use a square design.

Because a square is the only format for which a requested size is unambiguous.

Just checked a random amazon book page, and it does not use a square design:

Event you can see that the miniatures on the page are shown in squared size which crops the content of the text.

Just my first 3 top results in google search: