Welcome! Log In Create A New Profile

Advanced

nginx image filter: image gets rotated instead of crop

Posted by drookie 
nginx image filter: image gets rotated instead of crop
December 30, 2020 06:44AM
Hello,

I have an old and proven to work config like this (like, literally, for dozen of years):

server {
listen 8085 default;
listen [::]:8085 default;

root /usr/local/public/storage;

location ~ ^/resize/([\d\-]+)x([\d\-]+)/(.+) {
set $width $1;
set $height $2;
rewrite ^/resize/([\d\-]+)x([\d\-]+)/(.+) /$3 break;
image_filter resize $width $height;
image_filter_buffer 10M;
image_filter_jpeg_quality 85;
}

location ~ ^/crop/([\d\-]+)x([\d\-]+)/(.+) {
set $width $1;
set $height $2;
rewrite ^/crop/([\d\-]+)x([\d\-]+)/(.+) /$3 break;
image_filter crop $width $height;
image_filter_buffer 10M;
image_filter_jpeg_quality 85;
}
}

(yeah, I'm awared that it's better to use all of this with secure link module, but this is a temporary test). This config works quite well, but suddenly some "vertical" images gets rotated instead of cropping:

original:
https://storage.test.tpark-it.ru/temp/2a569fff220c6d40cbb43ae65c142028.jpg

derivative:
https://storage.test.tpark-it.ru/crop/100x100/temp/2a569fff220c6d40cbb43ae65c142028.jpg (notice it's rotated)

Why is that ? Really cannot figure this out. Seems like this is the only pic so far. Others seems to do well:

https://storage.test.tpark-it.ru/3641f5e9a89b8eb49eae2d408235fad9.png
https://storage.test.tpark-it.ru/crop/100x-/3641f5e9a89b8eb49eae2d408235fad9.png

Does this have something to do with the fact that this "bad" pic is "vertical" ?

Thanks.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 48
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready