P
P
Pavel Khorikov2015-08-11 14:18:42
Yii
Pavel Khorikov, 2015-08-11 14:18:42

How to implement aspect ratio thumbnails generation functionality in Yii2?

There is some area on the page fixed in width and height - let's say this -
6e30c0c2626047d4a850e44f7eeb4b8e.png
There is an obviously known (maximum three) number of images allowed to be uploaded to the page with different ratios, orientations (landscape, album) and different sizes.
In other words, there are three options for the location of images in the above area:
I will illustrate with an example, let this image be the source image uploaded by the user:
6aaec278e9694b849d1814563e51785a.jpg
Therefore, the possible options for resizing and generating thumbs will look like this:
1 image uploaded:
fa39d6b829f944c8a0b18a2351709167.png
2 images uploaded:
584198f1eaa64406acfc93ee134990fc.png
Uploaded 3 images:
e3304c57e892483ab0149186bc94cbe5.png
In other words, you need a smart resizer and a miniature generator, or a plan (how to file) if there is no resizer.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xmoonlight, 2015-08-11
@xmoonlight

on GD2 - write in an hour.

P
Paulus, 2015-08-12
@ppokrovsky

https://github.com/CostaRico/yii2-images

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question