Closed Tippit closed 9 years ago
I asked this before as well, how do it become if you try changing to setup?
ok I still try and tell you, thank's
Le 12 août 2015 à 02:28, Sho Yakushiji notifications@github.com a écrit :
I asked this before as well, how do it become if you try changing to setup?
— Reply to this email directly or view it on GitHub.
UIImagePickerController in setup it's ok, so _blendImage = [info objectForKey:UIImagePickerControllerOriginalImage];
_blendImage declared as @property (nonatomic, strong) UIImage *_blendImage; in CLEffectTool
how to pass blendImage to (UIImage)applyEffect:(UIImage_)image in CLCustomEffectTool
I think it's not my issue. It is totally up to you. But if it were me I'd probably do it as below.
- (id)initWithSuperView:(UIView*)superview imageViewFrame:(CGRect)frame toolInfo:(CLImageToolInfo*)info
{
self = [super initWithSuperView:superview imageViewFrame:frame toolInfo:info];
if(self){
// The rest of your method implementation.
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
UIViewController *vc = [[[UIApplication sharedApplication] keyWindow] rootViewController];
while (vc.presentedViewController) { vc = vc.presentedViewController; }
[vc presentViewController:picker animated:YES completion:nil];
}
return self;
}
i tried then
I had in CLCustomEffect.m
@implementation CLCustomEffect
{
UIImage *_blendImage;
...
}
}
... GPUImageDissolveBlendFilter *blendFilter = [[GPUImageDissolveBlendFilter alloc]init];
UIImage *quickFilteredImage = [blendFilter imageByFilteringImage:_blendImage];
}
at runtime I get a crash
Assertion failure in -[GPUImagePicture initWithCGImage:smoothlyScaleOutput:],iOS9/_Demo/CLImageEditorDemo/SDKs/GPUImage/framework/Source/iOS/GPUImagePicture.m:74 2015-08-12 11:06:24.404 MyApp[22255:986445] *\ Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Passed image must not be empty - it should be at least 1px tall and wide'
Did you write properly also other part? Sample is a minimum code, so it doesn't available by copy and paste.
I checked my code but - (id) initWithSuperView: (UIView ) superview imageViewFrame (CGRect) frame TOOLINFO (CLImageToolInfo ) info
thank you is the right solution
?
it’s ok for me Yackle still have the same issue I will review my code :)
Merci beaucoup :))
Le 12 août 2015 à 12:05, Sho Yakushiji notifications@github.com a écrit :
?
— Reply to this email directly or view it on GitHub https://github.com/yackle/CLImageEditor/issues/115#issuecomment-130246332.
hi,
I return to my previous question regarding the use of "UIImagePickerController" I use "CLEffectTool" to apply a "GPUImageDissolveBlendFilter" filter on the image in the editor.
This filter requires me to provide an additional image (overlay) I wish to load it from my photo album, so I need to use UIImagePickerController instead of Bundle.
I can not find any place I have to call UIImagePickerController and then recover the selected image for use in my filter.
Here is a sample code in my customEffect.m :
(UIImage)applyEffect:(UIImage)image { inputImage = [UIImage imageNamed:@"Colorful_24.jpg"]; //// I will wish that inputImage comes from my photo album
GPUImagePicture *imageSource = [[GPUImagePicture alloc] initWithImage:image]; [imageSource processImage];
GPUImageDissolveBlendFilter blendFilter = [[GPUImageDissolveBlendFilter alloc]init]; GPUImageExposureFilter brightNessFilter = [[GPUImageExposureFilter alloc] init]; GPUImageContrastFilter *contrastFilter = [[GPUImageContrastFilter alloc] init];
[(GPUImageDissolveBlendFilter )blendFilter setMix:_radiusSlider.value]; [(GPUImageExposureFilter )brightNessFilter setExposure:_brightnessSlider.value]; [(GPUImageContrastFilter *)contrastFilter setContrast:_contrastSlider.value];
[imageSource addTarget:blendFilter]; [imageSource addTarget:brightNessFilter]; [imageSource addTarget:contrastFilter]; [imageSource processImage];
UIImage quickFilteredImage1 = [blendFilter imageByFilteringImage:inputImage]; UIImage quickFilteredImage2 = [brightNessFilter imageByFilteringImage:quickFilteredImage1 ]; UIImage *quickFilteredImage = [contrastFilter imageByFilteringImage:quickFilteredImage2 ];
[imageSource removeAllTargets];
imageSource = nil; blendFilter = nil; brightNessFilter = nil; contrastFilter = nil;
return quickFilteredImage;
}
Could you help me with some advice or with some sample code I am beginner and I'm struggling to find the right method, thank you in advance for your attention