unjs / ipx

🖼️ High performance, secure and easy-to-use image optimizer.
MIT License
1.54k stars 61 forks source link

Problem with images without image extention in URL #17

Closed farnabaz closed 3 years ago

farnabaz commented 3 years ago

The IPX has an issue with detecting a suitable format for remote images without the file extension. like Unsplash images:

https://images.unsplash.com/photo-1606112219348-204d7d8b94ee?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1940&q=80

We should drop the format detection logic and handle unknown formats. https://github.com/nuxt-contrib/ipx/blob/master/src/ipx.ts#L124-L127

\cc @pi0