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

Fixes: #360, #534, #690, #716: Display default image in case of broken image URL response from twitter servers #742

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/app/feed/user-info-box/user-info-box.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<div *ngIf="(!isUserResponseLoading)" class="wrapper">
<div class="image-gallery">
<div class="profile-banner-image">
<img class="banner" src="{{ apiResponseUser.profile_banner_url }}"/>
<img class="banner" src="{{ apiResponseUser.profile_banner_url }}" onError="this.src='./assets/images/default600x200.jpg';"/>
</div>
<div class="profile-image">
<img src="{{ apiResponseUser.profile_image_url }}"/>
<img src="{{ apiResponseUser.profile_image_url }}" onError="this.src='./assets/images/def65.jpg';"/>
Copy link
Member Author

@simsausaurabh simsausaurabh Jun 7, 2018

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.

</div>
</div>
<div>
Expand Down Expand Up @@ -56,7 +56,7 @@ <h3>Followers</h3>
<li class="gallery-item" *ngFor="let item of (sortedApiResponseUserFollowers.slice(0,3)); let i = index ">
<a [routerLink]="['/search']" [queryParams]="{ query : 'from:' + item.screen_name }">
<div class="item-image">
<img src="{{ item.profile_image_url }}"/>
<img src="{{ item.profile_image_url }}" onError="this.src='./assets/images/def94.jpg';"/>
</div>
<div class="item-desc">
<div class="item-name">
Expand All @@ -79,7 +79,7 @@ <h3>Following</h3>
<li class="gallery-item" *ngFor="let item of (sortedApiResponseUserFollowing.slice(0,3)); let i = index ">
<a [routerLink]="['/search']" [queryParams]="{ query : 'from:' + item.screen_name }">
<div class="item-image">
<img src="{{ item.profile_image_url }}"/>
<img src="{{ item.profile_image_url }}" onError="this.src='./assets/images/def94.jpg';"/>
</div>
<div class="item-desc">
<div class="item-name">
Expand Down
Binary file added src/assets/images/def65.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/def94.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/default600x200.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.