nodeca / probe-image-size

Get image size without full download. Supported image types: JPG, GIF, PNG, WebP, BMP, TIFF, SVG, PSD, ICO.
MIT License
978 stars 77 forks source link

Improve parser ordering to speed up probe #65

Closed styxlab closed 2 years ago

styxlab commented 2 years ago

@puzrin Thanks so much for this great package that I seem to be coming back to!

Just wondering if you could optimize the performance by changing the loop order over all formats (currently in alphabetical order), see

I understand that the file name or extension does not a guarantee that the image is of that format. Here is my suggestion:

Thanks a lot for the consideration!

puzrin commented 2 years ago

I don't like optimizations "just for fun". Do you have some concrete metrics to prove real problems with speed?

puzrin commented 2 years ago

Closed (no reasonable proofs)