Переглянути джерело

RA Image
添加图片压缩

Ray Zhang 9 роки тому
батько
коміт
9a20931f72

+ 6 - 0
RA Image/RA Image.xcodeproj/project.pbxproj

@@ -54,6 +54,7 @@
 		71114AF21EB2DEF900D2200C /* ScannerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71114AEB1EB2DEF900D2200C /* ScannerViewController.m */; };
 		71114AF21EB2DEF900D2200C /* ScannerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71114AEB1EB2DEF900D2200C /* ScannerViewController.m */; };
 		71114AF31EB2DEF900D2200C /* SCShapeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 71114AED1EB2DEF900D2200C /* SCShapeView.m */; };
 		71114AF31EB2DEF900D2200C /* SCShapeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 71114AED1EB2DEF900D2200C /* SCShapeView.m */; };
 		71749AFD1ECC199300018EEC /* UIImage+fixOrientation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71749AFC1ECC199300018EEC /* UIImage+fixOrientation.m */; };
 		71749AFD1ECC199300018EEC /* UIImage+fixOrientation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71749AFC1ECC199300018EEC /* UIImage+fixOrientation.m */; };
+		717A37AE1ED6BF0700E09FB6 /* ImageUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 717A37AD1ED6BF0700E09FB6 /* ImageUtils.m */; };
 		71961CB01EC00DDD002C4096 /* RANetworkTaskDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 71961CAB1EC00DDD002C4096 /* RANetworkTaskDelegate.m */; };
 		71961CB01EC00DDD002C4096 /* RANetworkTaskDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 71961CAB1EC00DDD002C4096 /* RANetworkTaskDelegate.m */; };
 		71961CB11EC00DDD002C4096 /* RAUploadManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 71961CAD1EC00DDD002C4096 /* RAUploadManager.m */; };
 		71961CB11EC00DDD002C4096 /* RAUploadManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 71961CAD1EC00DDD002C4096 /* RAUploadManager.m */; };
 		71961CB21EC00DDD002C4096 /* RAUploadOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71961CAF1EC00DDD002C4096 /* RAUploadOperation.m */; };
 		71961CB21EC00DDD002C4096 /* RAUploadOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 71961CAF1EC00DDD002C4096 /* RAUploadOperation.m */; };
@@ -158,6 +159,8 @@
 		71114AED1EB2DEF900D2200C /* SCShapeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SCShapeView.m; path = ../../common/SCShapeView.m; sourceTree = "<group>"; };
 		71114AED1EB2DEF900D2200C /* SCShapeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SCShapeView.m; path = ../../common/SCShapeView.m; sourceTree = "<group>"; };
 		71749AFB1ECC199300018EEC /* UIImage+fixOrientation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIImage+fixOrientation.h"; path = "../../common/UIImage+fixOrientation.h"; sourceTree = "<group>"; };
 		71749AFB1ECC199300018EEC /* UIImage+fixOrientation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIImage+fixOrientation.h"; path = "../../common/UIImage+fixOrientation.h"; sourceTree = "<group>"; };
 		71749AFC1ECC199300018EEC /* UIImage+fixOrientation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIImage+fixOrientation.m"; path = "../../common/UIImage+fixOrientation.m"; sourceTree = "<group>"; };
 		71749AFC1ECC199300018EEC /* UIImage+fixOrientation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIImage+fixOrientation.m"; path = "../../common/UIImage+fixOrientation.m"; sourceTree = "<group>"; };
+		717A37AC1ED6BF0700E09FB6 /* ImageUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ImageUtils.h; path = "../../RedAnt ERP Mobile/common/ImageUtils.h"; sourceTree = "<group>"; };
+		717A37AD1ED6BF0700E09FB6 /* ImageUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ImageUtils.m; path = "../../RedAnt ERP Mobile/common/ImageUtils.m"; sourceTree = "<group>"; };
 		71961CAA1EC00DDD002C4096 /* RANetworkTaskDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RANetworkTaskDelegate.h; path = ../../common/upload/RANetworkTaskDelegate.h; sourceTree = "<group>"; };
 		71961CAA1EC00DDD002C4096 /* RANetworkTaskDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RANetworkTaskDelegate.h; path = ../../common/upload/RANetworkTaskDelegate.h; sourceTree = "<group>"; };
 		71961CAB1EC00DDD002C4096 /* RANetworkTaskDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RANetworkTaskDelegate.m; path = ../../common/upload/RANetworkTaskDelegate.m; sourceTree = "<group>"; };
 		71961CAB1EC00DDD002C4096 /* RANetworkTaskDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RANetworkTaskDelegate.m; path = ../../common/upload/RANetworkTaskDelegate.m; sourceTree = "<group>"; };
 		71961CAC1EC00DDD002C4096 /* RAUploadManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RAUploadManager.h; path = ../../common/upload/RAUploadManager.h; sourceTree = "<group>"; };
 		71961CAC1EC00DDD002C4096 /* RAUploadManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RAUploadManager.h; path = ../../common/upload/RAUploadManager.h; sourceTree = "<group>"; };
@@ -390,6 +393,8 @@
 				71114AA51EB1C50D00D2200C /* RAUtils.m */,
 				71114AA51EB1C50D00D2200C /* RAUtils.m */,
 				71114ACD1EB1C79300D2200C /* Reachability.h */,
 				71114ACD1EB1C79300D2200C /* Reachability.h */,
 				71114ACE1EB1C79300D2200C /* Reachability.m */,
 				71114ACE1EB1C79300D2200C /* Reachability.m */,
+				717A37AC1ED6BF0700E09FB6 /* ImageUtils.h */,
+				717A37AD1ED6BF0700E09FB6 /* ImageUtils.m */,
 			);
 			);
 			name = util;
 			name = util;
 			sourceTree = "<group>";
 			sourceTree = "<group>";
@@ -628,6 +633,7 @@
 				71114AF31EB2DEF900D2200C /* SCShapeView.m in Sources */,
 				71114AF31EB2DEF900D2200C /* SCShapeView.m in Sources */,
 				71961CB11EC00DDD002C4096 /* RAUploadManager.m in Sources */,
 				71961CB11EC00DDD002C4096 /* RAUploadManager.m in Sources */,
 				71114AF21EB2DEF900D2200C /* ScannerViewController.m in Sources */,
 				71114AF21EB2DEF900D2200C /* ScannerViewController.m in Sources */,
+				717A37AE1ED6BF0700E09FB6 /* ImageUtils.m in Sources */,
 				42BC2D091EBAC75F0016B30D /* TouchImageView.m in Sources */,
 				42BC2D091EBAC75F0016B30D /* TouchImageView.m in Sources */,
 				42A829C31EBC0F8300898B8A /* ManufacturerListController.m in Sources */,
 				42A829C31EBC0F8300898B8A /* ManufacturerListController.m in Sources */,
 				71114AB61EB1C5C800D2200C /* NSString+Base64.m in Sources */,
 				71114AB61EB1C5C800D2200C /* NSString+Base64.m in Sources */,

BIN
RA Image/RA Image.xcodeproj/project.xcworkspace/xcuserdata/ray.xcuserdatad/UserInterfaceState.xcuserstate


+ 1 - 1
RA Image/RA Image/AppDelegate.h

@@ -23,7 +23,7 @@
 @property (nonatomic,copy) UIImage *companyIcon;
 @property (nonatomic,copy) UIImage *companyIcon;
 @property (nonatomic,strong) NSArray *modeList;
 @property (nonatomic,strong) NSArray *modeList;
 @property (nonatomic,assign) BOOL shouldAutoShowModeVC;
 @property (nonatomic,assign) BOOL shouldAutoShowModeVC;
-
+@property (assign) bool bEnable_Cache;
 - (void)showNormalRootVC;
 - (void)showNormalRootVC;
 - (void)showLoginVC;
 - (void)showLoginVC;
 - (void)logout;
 - (void)logout;

+ 4 - 0
RA Image/RA Image/BasicModeViewController.m

@@ -13,6 +13,7 @@
 #import <AVFoundation/AVFoundation.h>
 #import <AVFoundation/AVFoundation.h>
 #import <AssetsLibrary/AssetsLibrary.h>
 #import <AssetsLibrary/AssetsLibrary.h>
 #import "TakePhotoPreviewController.h"
 #import "TakePhotoPreviewController.h"
+#import "ImageUtils.h"
 
 
 
 
 #pragma clang diagnostic push 
 #pragma clang diagnostic push 
@@ -283,6 +284,9 @@
 }
 }
 
 
 - (NSString *)saveImage:(UIImage *)img {
 - (NSString *)saveImage:(UIImage *)img {
+    
+    img = [ImageUtils img_compress:img kbsize:1024];
+    
     NSString *dir = [NSString stringWithFormat:@"%@/%@",NSTemporaryDirectory(),self.name];
     NSString *dir = [NSString stringWithFormat:@"%@/%@",NSTemporaryDirectory(),self.name];
     
     
     NSDate * date = [NSDate date];
     NSDate * date = [NSDate date];