Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ehost fails when image is png or gif instead of jpg #235

Closed
tresni opened this issue Dec 30, 2012 · 3 comments
Closed

ehost fails when image is png or gif instead of jpg #235

tresni opened this issue Dec 30, 2012 · 3 comments

Comments

@tresni
Copy link

tresni commented Dec 30, 2012

RES will barf on http://eho.st/pp7c1v8x & http://eho.st/pg9kthis which are PNG and GIF files respectively.

May be possible to use some JS and switch formats if loading the jpg fails. Something like:

<!-- clear the onerror, switch the src, keep going! -->
<img src="http://i.eho.st/pg9kthis.jpg" onerror="if (this.src.match(/\.jpg/)) { this.src = 'http://i.eho.st/pg9kthis.png'; return true; } else { this.onerror = ''; this.src = 'http://i.eho.st/pg9kthis.gif'; return true; }" />
patricksnape pushed a commit to patricksnape/Reddit-Enhancement-Suite that referenced this issue Feb 6, 2013
This could also help by allowing other image hosting site
extensions to leverage the onerror function
@patricksnape
Copy link
Collaborator

Test post works in Chrome on my machine after applying my patch. Could be a nice fix in general, allowing an onerror function to be set, though we may also want to add it to the gallery etc.

honestbleeps added a commit that referenced this issue Feb 13, 2013
Fixes issue #235 by adding an onerror function
@patricksnape
Copy link
Collaborator

Close as fixed?

@honestbleeps
Copy link
Owner

yes :) fixed

patricksnape pushed a commit to patricksnape/Reddit-Enhancement-Suite that referenced this issue Jun 23, 2013
This could also help by allowing other image hosting site
extensions to leverage the onerror function
patricksnape pushed a commit to patricksnape/Reddit-Enhancement-Suite that referenced this issue Jun 23, 2013
patricksnape pushed a commit that referenced this issue Sep 2, 2013
This could also help by allowing other image hosting site
extensions to leverage the onerror function
honestbleeps added a commit that referenced this issue Sep 2, 2013
Fixes issue #235 by adding an onerror function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants