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

Fix #1020: Rendering of Svg images from server. #1019

Merged
merged 25 commits into from
May 12, 2020
Merged

Fix #1020: Rendering of Svg images from server. #1019

merged 25 commits into from
May 12, 2020

Conversation

veena14cs
Copy link
Contributor

@veena14cs veena14cs commented Apr 24, 2020

Explanation

This PR fixes issue #1020. It implements rendering of svg images from server.

For Testing

  1. In GlideImageLoader on line number 49 replace model with url "https://cdn.shopify.com/s/files/1/0496/1029/files/Freesample.svg"
  2. In assets folder goto fraction_exploration0.json file. Search for image name img_20180121_113315_pqwqhf863w_height_565_width_343 and replace png to svg.

@veena14cs veena14cs changed the title Fix: Rendering of Svg images from server[DO NOT MERGE]. Fix #1020: Rendering of Svg images from server. Apr 24, 2020
Copy link
Contributor

@rt4914 rt4914 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add test cases to add various public functions in this PR.

Otherwise as per your suggested changes your PR is working correctly. Thanks.

@rt4914 rt4914 assigned veena14cs and unassigned rt4914 Apr 24, 2020
@veena14cs
Copy link
Contributor Author

Add test cases to add various public functions in this PR.

There is issue #277 that need to have testcase for image loading. So I haven't added it here. Issue is mentioned in UrlImageParser file.

@aggarwalpulkit596
Copy link
Contributor

Are we handling the fallback case if the image is not an SVG?

@veena14cs
Copy link
Contributor Author

Are we handling the fallback case if the image is not an SVG?

Yes.

@aggarwalpulkit596
Copy link
Contributor

We can add one more case though to render the url as png if svg fails because some websites have a redirect mechanism in svg url which redirects to png url

@aggarwalpulkit596
Copy link
Contributor

@veena14cs there is an error function in glide which executes if the image fails to render we can add png/svg clause in case of a failure

@veena14cs
Copy link
Contributor Author

@veena14cs there is an error function in glide which executes if the image fails to render we can add png/svg clause in case of a failure

In that case you can create a PR and will check it.

@veena14cs veena14cs assigned rt4914 and unassigned veena14cs Apr 27, 2020
@veena14cs veena14cs requested a review from rt4914 April 27, 2020 08:22
Copy link
Contributor

@rt4914 rt4914 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-flaky tests are failing, else looks good.

@rt4914 rt4914 assigned veena14cs and unassigned rt4914 Apr 28, 2020
Copy link
Contributor

@nikitamarysolomanpvt nikitamarysolomanpvt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non_flaky_tests are failing PTAL

@nikitamarysolomanpvt nikitamarysolomanpvt removed their assignment Apr 28, 2020
@BenHenning
Copy link
Sponsor Member

BenHenning commented May 5, 2020

Thanks @veena14cs--in the future please assign me the pull request once you need some sort of action item from me (e.g. answering a question or doing another review) so that I can find it more easily. Thanks! :)

I will try to take a look today.

@BenHenning BenHenning assigned BenHenning and unassigned veena14cs May 5, 2020
@veena14cs
Copy link
Contributor Author

Thanks @veena14cs--in the future please assign me the pull request once you need some sort of action item from me (e.g. answering a question or doing another review) so that I can find it more easily. Thanks! :)

I will try to take a look today.

Sure @BenHenning thanks.

Copy link
Sponsor Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @veena14cs! Just a few more comments.

Also, can you make sure all comment threads that are resolved are marked as resolved, otherwise there's a clear question to follow up on them? That makes it easier for me to go back and comment on old threads.

@BenHenning BenHenning assigned veena14cs and unassigned BenHenning May 6, 2020
@veena14cs veena14cs assigned BenHenning and unassigned veena14cs May 7, 2020
@veena14cs
Copy link
Contributor Author

Thanks @veena14cs! Just a few more comments.

Also, can you make sure all comment threads that are resolved are marked as resolved, otherwise there's a clear question to follow up on them? That makes it easier for me to go back and comment on old threads.

@BenHenning I have addressed your comments also I changed some of the implementation and removed some files which may not be necessary and could load svg's without any issues.

Copy link
Sponsor Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @veena14cs! I reopened a couple of the past conversation threads--please resolve those & my new comment before submitting. Otherwise the changes look good. Thanks for implementing this!

If you have any questions about my comments, please ask or reassign the PR to me before submitting.

@BenHenning BenHenning assigned veena14cs and unassigned BenHenning May 8, 2020
@veena14cs
Copy link
Contributor Author

Thanks @veena14cs! I reopened a couple of the past conversation threads--please resolve those & my new comment before submitting. Otherwise the changes look good. Thanks for implementing this!

If you have any questions about my comments, please ask or reassign the PR to me before submitting.

Changed the implementation as per the discussion. @BenHenning Please take a final look before I submit this PR.

@veena14cs veena14cs assigned BenHenning and unassigned veena14cs May 11, 2020
@@ -93,7 +94,7 @@ class UrlImageParser private constructor(
}
}

class UrlDrawable : BitmapDrawable() {
class UrlDrawable : BitmapDrawable(){
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest reverting this (e.g. BitmapDrawable() {).

Copy link
Sponsor Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @veena14cs--this LGTM!

@BenHenning BenHenning assigned veena14cs and unassigned BenHenning May 12, 2020
@veena14cs veena14cs merged commit d16d6d6 into develop May 12, 2020
@veena14cs veena14cs deleted the render-svg branch May 12, 2020 05:45
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

Successfully merging this pull request may close these issues.

None yet

5 participants