It happens that some images are not very wide, but they are very high, or very wide, but not very high. In this case, if we want to do a simple resizing, we can have unwanted sizes.
Example:
$image = new Imagine('./my-picture.jpg'); // width: 100px - height: 500px
$image->setWidth(300);
$image->save('./my-picture-bigger.jpg'); // width: 300px - height: 1500px
In some cases, you may not want to exceed a certain limit, depending on disk space constraints or on the choice of the artistic direction. It should be possible to limit this.
Possibility to study:
$image = new Imagine('./my-picture.jpg'); // width: 100px - height: 500px
$image->setWidth(750);
$image->setHeight(750);
$image->setIsMaximumSize();
$image->save('./my-picture-bigger.jpg'); // width: 150px - height: 750px
It happens that some images are not very wide, but they are very high, or very wide, but not very high. In this case, if we want to do a simple resizing, we can have unwanted sizes.
Example:
In some cases, you may not want to exceed a certain limit, depending on disk space constraints or on the choice of the artistic direction. It should be possible to limit this.
Possibility to study: