thephpleague / glide

Wonderfully easy on-demand image manipulation library with an HTTP based API.
http://glide.thephpleague.com
MIT License
2.55k stars 198 forks source link

Break out the list of supported image formats #346

Closed Synchro closed 1 year ago

Synchro commented 2 years ago

...so that it's visible from outside. As far as I can see there is no public way to obtain a list of the image formats that glide supports (other than docs), so I've moved it to a static method in the Encode Manipulator, and I use that from its own methods too. It's static so it can be overridden easily if someone wants to add (or remove) a format.

This is just an idea – I found that I wanted to find this out when using glide from spatie/image, as otherwise it has to maintain its own list of supported formats, which isn't very DRY.