-
Notifications
You must be signed in to change notification settings - Fork 578
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
Fixes: #360, #534, #690, #716: Display default image in case of broken image URL response from twitter servers #742
Conversation
…y default image in case of broken image URL response from twitter
Codecov Report
@@ Coverage Diff @@
## master #742 +/- ##
=======================================
Coverage 53.41% 53.41%
=======================================
Files 107 107
Lines 2881 2881
Branches 374 374
=======================================
Hits 1539 1539
Misses 1218 1218
Partials 124 124 Continue to review full report at Codecov.
|
@singhpratyush @hemantjadon @praveenojha33 please review. |
@praveenojha33 Please try this link: http://loud-relation.surge.sh |
@simsausaurabh The problem persist with this link as well |
@praveenojha33 Results are coming, please try again! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @simsausaurabh When I made a query from:simsausaurabh
on your deployed PR and on loklak.org I got this result
As you can see some images are available but for that also default image is shown. Please look into it.
@praveenojha33 The count of request response is more on hosted website i.e. Loklak.org. The test PR is deployed on surge and its response capacity is less in comparison to loklak.org. That is why whenever you will search from loklak.org, you will get less broken results in comparision to your local deployment. Its a problem with the surge, which is not able to fetch/hold that match response. And the patch correctly displays default image when there is unavailable image url from twitter. This won't be a problem once the patch gets merged, you will see less default images and more twitter images. |
Hello @simsausaurabh Now I have compared it with a surge link of previous PR and surge link for this PR . I get this result for surge link of PR 730 |
</div> | ||
<div class="profile-image"> | ||
<img src="{{ apiResponseUser.profile_image_url }}"/> | ||
<img src="{{ apiResponseUser.profile_image_url }}" onError="this.src='./assets/images/def65.jpg';"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@praveenojha33 The default image gets load only when there is any error(like broken URL). I have not replaced the original response url. As mentioned in the PR description, the problem is with twitter image servers, which do not allow to access a lot of images and sometimes none. And it also depends on host's response capacity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, Lets see how it works on Loklak.org
I am not sure, if this is the best approach, cause it does not start to path a way to solve the issue. A better approach would seem to me to implement the solution on the server itself. |
I looked into the current available solutions. But still I'll try to work on to resolve this on server side. Thanks @mariobehling 👍 |
Why are you committing this to master? Commit to dev, please. |
Changes proposed in this pull request
The URLs returned by api.loklak won't work for sometimes, although they are originally extracted from twitter. But the problem is with twitter image servers, which do not allow to access a lot of images and sometimes none. For more information please see https://twittercommunity.com/t/original-profile-image-not-found/67046. Until a reasonable solution is found on twitter server side, a default image should be placed inside of empty broken image containers with required resolution of the container.
This patch adds default image on broken url response in user-info-box in sidebar(To replace Profile banner image, Profile images of twitter accounts i.e. user, following, and followers).
Screenshots (if appropriate)
Will provide once the api.loklak starts again, currently its down.
Link to live demo: http://pr-742-fossasia-loklaksearch.surge.sh
Parent issue #534, #716
Closes #360 #690