eahanson / imageproxy

MIT License
85 stars 17 forks source link

Fallback/Default image? #13

Open mahemoff opened 11 years ago

mahemoff commented 11 years ago

Is there any way to specify an image to be served if the source image is broken?

bingeboy commented 11 years ago

I'm just thinking off the top of my head but you could try and have a default image stored in localStorage to test against.

eahanson commented 11 years ago

For simplicity, imageproxy uses curl to download the image and pipes the result directly into imagemagick. I can't off the top of my head think of a way to handle a default/fallback image without making some big changes there.

Ideas and/or pull requests are welcome though!

mahemoff commented 11 years ago

Thanks, I'm not using it yet, but if I do, I could add that pull request.

I think (hope) it should be fairly trivial to just detect a failed request and substitute another URL.

opensourceame commented 9 years ago

What about using something like HTTParty instead of curl ?

francescomagnoni commented 8 years ago

if you have apache in front of image proxy you can handle with it:

ErrorDocument 500 defaultImage.png