imageproxy icon indicating copy to clipboard operation
imageproxy copied to clipboard

Fallback/Default image?

Open mahemoff opened this issue 12 years ago • 5 comments

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

mahemoff avatar Jun 20 '13 14:06 mahemoff

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.

bingeboy avatar Jun 22 '13 05:06 bingeboy

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!

eahanson avatar Jun 24 '13 20:06 eahanson

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.

mahemoff avatar Jun 24 '13 20:06 mahemoff

What about using something like HTTParty instead of curl ?

opensourceame avatar Jul 17 '15 15:07 opensourceame

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

ErrorDocument 500 defaultImage.png

francescomagnoni avatar Dec 31 '15 09:12 francescomagnoni