You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Xu,
Good contribution to cordova wechat plugin. I have used this great plugin in my meteor apps. It works gracefully.
One suggestion: current URL only supports remote webpage url or local file based url. I am wondering whether there is an possibility to add an option for the base64 image in 'getNSDataFromURL'
This small piece of code work well if I provide a base64 image by url
base64 string like this data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4QBARXhpZgAATU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAGVKADAAQAAAABAAAGVAAAAA....
yes, is work . please add code to you project
thanks a lot
Hi Xu,
Good contribution to cordova wechat plugin. I have used this great plugin in my meteor apps. It works gracefully.
One suggestion: current URL only supports remote webpage url or local file based url. I am wondering whether there is an possibility to add an option for the base64 image in 'getNSDataFromURL'
This small piece of code work well if I provide a base64 image by url
(NSData *)getNSDataFromURL:(NSString *)url
{
NSData *data = nil;
if ([url hasPrefix:@"http://"] || [url hasPrefix:@"https://"])
{
data = [NSData dataWithContentsOfURL:[NSURL URLWithString:url]];
}
/* Added code_/
else if ([url hasPrefix:@"data:image"]) {
// a base 64 string
NSURL *actualURL = [NSURL URLWithString:url];
data = [NSData dataWithContentsOfURL:actualURL];
}
/_end of added code */
else
{
// local file
url = [[NSBundle mainBundle] pathForResource:[url stringByDeletingPathExtension] ofType:[url pathExtension]];
data = [NSData dataWithContentsOfFile:url];
}
return data;
}
Thanks,
Chen
The text was updated successfully, but these errors were encountered: