-
Notifications
You must be signed in to change notification settings - Fork 25k
Make bounds and resizeMode of gif network images respond to styles #353
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,9 +62,8 @@ - (void)setImageURL:(NSURL *)imageURL resetToDefaultImageWhileLoading:(BOOL)rese | |
| _downloadToken = [_imageDownloader downloadDataForURL:imageURL block:^(NSData *data, NSError *error) { | ||
| if (data) { | ||
| CAKeyframeAnimation *animation = RCTGIFImageWithData(data); | ||
| CGImageRef firstFrame = (__bridge CGImageRef)animation.values.firstObject; | ||
| self.layer.bounds = CGRectMake(0, 0, CGImageGetWidth(firstFrame), CGImageGetHeight(firstFrame)); | ||
| self.layer.contentsScale = 1.0; | ||
| self.layer.bounds = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height); | ||
| self.layer.contentsScale = RCTScreenScale(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this line is unnecessary but I may be wrong.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I remove it then the image does not show up at all, so it seems necessary
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Basically we don't currently support
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @a2 - good point, let's just make this 1.0 and we can open a separate issue for |
||
| self.layer.contentsGravity = kCAGravityResizeAspect; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You'll want to change the
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point again, I suppose we can just remove this line entirely too |
||
| self.layer.minificationFilter = kCAFilterLinear; | ||
| self.layer.magnificationFilter = kCAFilterLinear; | ||
|
|
||
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.
This line is unnecessary.
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.
Good point, removed