M
M
magary42017-07-24 17:59:40
symfony
magary4, 2017-07-24 17:59:40

How to resize an image based on orientation?

everything goes through the standard LiipImagineBundle

myf:
            quality: 85
            jpeg_quality: 85
            filters:
                strip: ~
                thumbnail:
                    size: [465, 465]
                    mode: inset

how to make it so that if the orientation of the picture is portrait, apply an array of filters A, and if not, then B

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan, 2017-07-27
@IvanCher

I do not remember exactly the methods of this library, but the logic seems to be simple:
1. In the code, we determine the orientation by the ratio of the side vertically and horizontally.
2. If the picture is in portrait orientation (width in X is less than in Y), then you do applyFilter (a), otherwise you apply filter b.
Why doesn't it fit?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question