tripviss / image-resizer

On-the-fly image resizing using Node.js and libvips. Heroku Ready!
MIT License
74 stars 45 forks source link

Cannot specify output format for path without extension #22

Open teohhanhui opened 8 years ago

teohhanhui commented 8 years ago

e.g. https://lh4.googleusercontent.com/-P4oxiHniRcc/V1Q0kGaDVMI/AAAAAAAAS44/JV4M46DxtWc54Rjb1pv2i29CACoUmS_6QCLIB/w4000-h3000-k/

There is no way to specify the output format since the current parsing requires the input format extension before it (e.g. .jpg.webp).

yamadapc commented 7 years ago

This would be fixed by using a querystring protocol for modifiers, instead of parsing the urls.

teohhanhui commented 7 years ago

Personally, I'd love to use the query string too (it's the proper solution). But how well does it work with CDNs? Probably okay if it's just extra configuration.

On Thu, 6 Oct 2016, 00:59 Pedro Tacla Yamada, notifications@github.com wrote:

This would be fixed by using a querystring protocol for modifiers, instead of parsing the urls.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tripviss/image-resizer/issues/22#issuecomment-251734502, or mute the thread https://github.com/notifications/unsubscribe-auth/AAhf69xKC-h54I5x46ieWtSxRRob-vKJks5qw9eDgaJpZM4Jc06t .

yamadapc commented 7 years ago

It works fine with cloudfront afaik. There's an initial lousy impl. in my fork.

Em qua, 5 de out de 2016 14:05, Teoh Han Hui notifications@github.com escreveu:

Personally, I'd love to use the query string too (it's the proper solution). But how well does it work with CDNs? Probably okay if it's just extra configuration.

On Thu, 6 Oct 2016, 00:59 Pedro Tacla Yamada, notifications@github.com wrote:

This would be fixed by using a querystring protocol for modifiers, instead of parsing the urls.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/tripviss/image-resizer/issues/22#issuecomment-251734502 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AAhf69xKC-h54I5x46ieWtSxRRob-vKJks5qw9eDgaJpZM4Jc06t

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tripviss/image-resizer/issues/22#issuecomment-251736055, or mute the thread https://github.com/notifications/unsubscribe-auth/ADvexg6jLAzjMP4MGfu2Ht3sdoUR9CJ6ks5qw9jggaJpZM4Jc06t .

yamadapc commented 7 years ago

Just to back this up a bit, I've seen other resizer CDNs, like filpicker's CDN and imgix.com do this; https://docs.imgix.com/setup/serving-images

I sort of doubt that the querystring isn't taken into account on all but only very few CDNs. Because the querystring is part of the URI, it's part of the key you really want to cache. CDNs that don't respect it seem broken to me.