weserv / images

Source code of wsrv.nl (formerly images.weserv.nl), to be used on your own server(s).
https://wsrv.nl/
BSD 3-Clause "New" or "Revised" License
1.86k stars 187 forks source link

Filename can't be orientation options #279

Closed errorID10TMC closed 3 years ago

errorID10TMC commented 3 years ago

When the filename is one of the orientation or some of the adjustment options it will change the images. An example of this using flip is below.

https://images.weserv.nl/?url=images.weserv.nl/lichtenstein.jpg&w=300&h=300&filename=flip

This image does have the filename of flip but the image is also flipped. This also happens with some filenames that include one of the options.

kleisauke commented 3 years ago

The problem was that the query string was parsed incorrectly. In some cases, key-value pairs could be misinterpreted as value-key pairs, as you discovered. This occurred for keys that were handled in the nginx module.

This has been fixed with commit https://github.com/weserv/images/commit/2bfc6bece48cf178a4e7b1f72bf06bf629e99847, which has just been rolled out to production. Thanks for reporting this!