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

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:


derivative: (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:

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

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 306
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready