imgix / js-core

A JavaScript client library for generating image URLs with imgix
https://www.imgix.com
BSD 2-Clause "Simplified" License
122 stars 21 forks source link

Ability to define success/failure/processing handlers #41

Closed jamesmorgan closed 5 years ago

jamesmorgan commented 5 years ago

It would be useful for us to defined a handler for if the image either fails to be handled or when it's being processed etc.

Is there a way to do this already?

Cheers

jayeb commented 5 years ago

Hmm, I'm not sure that feature makes sense in this library. imgix-core-js, like our core libraries in other languages, is primarily concerned with constructing, signing, and manipulating imgix URLs. The library doesn't deal with the loading of images at all, so adding handlers to track in-progress of failed loads doesn't really fit here.

I'm going to close this ticket since I don't think it's going to result in any code-changes here, but I'm happy to discuss your imgix set-up a bit more and figure out how you can get do what you need. Are you using any kind of web or application framework on top of imgix-core-js? Once your application uses imgix-core-js to generate a URL, how are you getting that URL into an <img> tag that shows up on the page?