|
@@ -243,11 +243,12 @@
|
|
|
|
|
|
|
|
__weak typeof(self) weakself = self;
|
|
__weak typeof(self) weakself = self;
|
|
|
RACameraViewController *cameraVC = [RACameraViewController showCameraFromViewController:self withTakeMode:RACameraTakeModeTakeASerial videoGravity:AVLayerVideoGravityResizeAspect completion:^(UIImage *img) {
|
|
RACameraViewController *cameraVC = [RACameraViewController showCameraFromViewController:self withTakeMode:RACameraTakeModeTakeASerial videoGravity:AVLayerVideoGravityResizeAspect completion:^(UIImage *img) {
|
|
|
-
|
|
|
|
|
|
|
+ AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
|
|
|
+ bool bcompress =appDelegate.compressFile;
|
|
|
if (img) {
|
|
if (img) {
|
|
|
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
|
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
|
|
UIImage *newImg = [img fixOrientation];
|
|
UIImage *newImg = [img fixOrientation];
|
|
|
- NSString *path = [weakself saveImage:newImg];
|
|
|
|
|
|
|
+ NSString *path = [weakself saveImage:newImg bcompress:bcompress];
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
if (path) {// 保存成功
|
|
if (path) {// 保存成功
|
|
|
[weakself receiveImage:newImg];
|
|
[weakself receiveImage:newImg];
|
|
@@ -390,10 +391,10 @@
|
|
|
[self receiveImage:img];
|
|
[self receiveImage:img];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-- (NSString *)saveImage:(UIImage *)img {
|
|
|
|
|
- AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
|
|
|
|
|
+- (NSString *)saveImage:(UIImage *)img bcompress:(bool) bcompress{
|
|
|
|
|
+ // AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
|
NSString *append = @"";
|
|
NSString *append = @"";
|
|
|
- if (appDelegate.compressFile) {
|
|
|
|
|
|
|
+ if (bcompress) {
|
|
|
img = [ImageUtils img_compress:img kbsize:1024];
|
|
img = [ImageUtils img_compress:img kbsize:1024];
|
|
|
append = @"_scaled";
|
|
append = @"_scaled";
|
|
|
}
|
|
}
|
|
@@ -514,8 +515,9 @@
|
|
|
- (NSDictionary *)saveSignature:(UIImage *)img {
|
|
- (NSDictionary *)saveSignature:(UIImage *)img {
|
|
|
|
|
|
|
|
if (img) {
|
|
if (img) {
|
|
|
-
|
|
|
|
|
- NSString *path = [self saveImage:img];
|
|
|
|
|
|
|
+ AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
|
|
|
+ bool bcompress =appDelegate.compressFile;
|
|
|
|
|
+ NSString *path = [self saveImage:img bcompress:bcompress];
|
|
|
|
|
|
|
|
if (path) {// 保存成功
|
|
if (path) {// 保存成功
|
|
|
NSString *md5 = [RAUtils md5WithFile:path];
|
|
NSString *md5 = [RAUtils md5WithFile:path];
|
|
@@ -610,8 +612,12 @@
|
|
|
__weak typeof(preVC) weakPreVC = preVC;
|
|
__weak typeof(preVC) weakPreVC = preVC;
|
|
|
preVC.photoHandler = ^(UIImage *img){
|
|
preVC.photoHandler = ^(UIImage *img){
|
|
|
if (img) {
|
|
if (img) {
|
|
|
|
|
+
|
|
|
|
|
+ AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
|
|
|
+ bool bcompress =appDelegate.compressFile;
|
|
|
|
|
+
|
|
|
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
|
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
|
|
- NSString *path = [weakself saveImage:img];
|
|
|
|
|
|
|
+ NSString *path = [weakself saveImage:img bcompress:bcompress];
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
if (path) {// 保存成功
|
|
if (path) {// 保存成功
|
|
|
[weakself receiveImage:img];
|
|
[weakself receiveImage:img];
|
|
@@ -639,8 +645,11 @@
|
|
|
|
|
|
|
|
image = [info objectForKey:UIImagePickerControllerOriginalImage];
|
|
image = [info objectForKey:UIImagePickerControllerOriginalImage];
|
|
|
[picker dismissViewControllerAnimated:YES completion:nil];
|
|
[picker dismissViewControllerAnimated:YES completion:nil];
|
|
|
|
|
+ AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
|
|
|
+ bool bcompress =appDelegate.compressFile;
|
|
|
|
|
+
|
|
|
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
|
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
|
|
- NSString *path = [self saveImage:image];
|
|
|
|
|
|
|
+ NSString *path = [self saveImage:image bcompress:bcompress];
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
if (path) {// 保存成功
|
|
if (path) {// 保存成功
|
|
|
[self receiveImage:image];
|
|
[self receiveImage:image];
|