-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add blur radius for iOS #591
base: main
Are you sure you want to change the base?
Conversation
Reset package-lock.json, doesn't seem related to the |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #591 +/- ##
=======================================
Coverage 94.11% 94.11%
=======================================
Files 1 1
Lines 17 17
=======================================
Hits 16 16
Misses 1 1 ☔ View full report in Codecov by Sentry. |
Any updates on this? |
@perrosnk The maintainers have provided no feedback 🤷♂ I'd like to get this change in so I can stop using a fork of the project |
Would be great to have this supported. |
+1 |
Any updates? |
Any updates on this? There are so many benefits to blurRadius. Right now I am conditionally rendering an image vs FastImage just to show a blur on the thumbnail (when the full resolution has not loaded yet). This creates duplication, but worse it usually takes the thumbnail longer to load vs the full res image (With FastImage) which defeats the purpose of trying to show the user that the image is loading... Props to the performance, but a minor feature like this would make such a huge difference! Keep up the great work. @DylanVann |
As a workaround, which has some fallbacks including less control over the blur, I implemented a |
@danleveille while good, I would definitely say implementing the blur natively in iOS (currently the only platform this PR supports) would be much more performant than nesting the view, and allows a progressive image loading like @nica0012, that's actually the reason we forked and did this, to do a seamless transition from blurred thumbnail to full view, while still taking advantage of the sdwebimage cache and the render performance |
How do you handle a preview image to be blurred on load, but if the full image is in the cache not to show the blur and immediately draw the full image? Is that supported in this fork? If the blur is drawn every time it would cause a lot of distracting flicker. |
Is there a way I can use this before it is merged? Is anyone using a fork of this with no issues? I've never really used a fork before I've just been waiting for this for sooo long I think I'll give it a shot if possible. |
just wrap it with react-native-blur |
|
Though that would work, it will increase my projects size and more packages to be installed, where as an update in RNFastImage would be much more ideal, and speedy! |
So we still use this branch at my company, but I just think it's funny that after a year the only real response was "add more React-native overhead and libraries to it". Restricting a basic feature like this because it doesn't support Android breaks the agreement that this is a drop-in replacement for the React Native Image object. For performance purposes, another library shouldn't be necessary and can result in an un-optimized experience since native code would likely not be doing the blurring effect |
very late response but the fork we use works fine on react-native 0.59+ |
It doesn't look like this package is very active anymore. It'd be nice if we could get a proper fork with active maintainers. |
any idea on how to add blur support for Android? 🙂 |
@DylanVann This is a pretty trivial, but very helpful update, is there anything that could be done to merge it? |
What about android support? |
I sometimes still think about this PR and what could have been, oh well. |
🤣 |
What are you guys gonna get this PR's 3 year anniversery? |
For me personally I wanted more of a gaussian blur which I achieved with: - (void)downloadImage:(FFFastImageSource *) source options:(SDWebImageOptions) options context:(SDWebImageContext *)context {
__weak typeof(self) weakSelf = self; // Always use a weak reference to self in blocks
id<SDImageTransformer> transformer = [SDImageBlurTransformer transformerWithRadius:_blurRadius];
[self sd_setImageWithURL:_source.url
placeholderImage:nil
options:options
context:@{SDWebImageContextImageTransformer: transformer}
progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) {
if (weakSelf.onFastImageProgress) {
weakSelf.onFastImageProgress(@{
@"loaded": @(receivedSize),
@"total": @(expectedSize)
});
}
} completed:^(UIImage * _Nullable image,
NSError * _Nullable error,
SDImageCacheType cacheType,
NSURL * _Nullable imageURL) {
if (error) {
weakSelf.hasErrored = YES;
if (weakSelf.onFastImageError) {
weakSelf.onFastImageError(@{});
}
if (weakSelf.onFastImageLoadEnd) {
weakSelf.onFastImageLoadEnd(@{});
}
} else {
weakSelf.hasCompleted = YES;
[weakSelf sendOnLoad:image];
if (weakSelf.onFastImageLoadEnd) {
weakSelf.onFastImageLoadEnd(@{});
}
}
}];
} |
any plan to merge it? |
|
This adds support for Blur Radius for iOS!