From c57f9d1d055cc7c3131ae63ef1acec052d92bd13 Mon Sep 17 00:00:00 2001 From: Florian Rival Date: Wed, 2 Dec 2015 22:53:06 +0100 Subject: [PATCH] Add iOS implementation --- .gitignore | 21 ++ README.md | 5 + RNImageResizer.xcodeproj/project.pbxproj | 274 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../RNImageResizer.xcscmblueprint | 30 ++ .../UserInterfaceState.xcuserstate | Bin 0 -> 13381 bytes .../xcschemes/RNImageResizer.xcscheme | 80 +++++ .../xcschemes/xcschememanagement.plist | 22 ++ RNImageResizer/ImageHelpers.h | 58 ++++ RNImageResizer/ImageHelpers.m | 180 ++++++++++++ RNImageResizer/ImageResizerModule.m | 83 ++++++ RNImageResizer/RNImageResizer.h | 13 + RNImageResizer/RNImageResizer.m | 13 + package.json | 18 +- 14 files changed, 797 insertions(+), 7 deletions(-) create mode 100644 .gitignore create mode 100644 RNImageResizer.xcodeproj/project.pbxproj create mode 100644 RNImageResizer.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 RNImageResizer.xcodeproj/project.xcworkspace/xcshareddata/RNImageResizer.xcscmblueprint create mode 100644 RNImageResizer.xcodeproj/project.xcworkspace/xcuserdata/florian.xcuserdatad/UserInterfaceState.xcuserstate create mode 100644 RNImageResizer.xcodeproj/xcuserdata/florian.xcuserdatad/xcschemes/RNImageResizer.xcscheme create mode 100644 RNImageResizer.xcodeproj/xcuserdata/florian.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 RNImageResizer/ImageHelpers.h create mode 100644 RNImageResizer/ImageHelpers.m create mode 100644 RNImageResizer/ImageResizerModule.m create mode 100644 RNImageResizer/RNImageResizer.h create mode 100644 RNImageResizer/RNImageResizer.m diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..69f8209 --- /dev/null +++ b/.gitignore @@ -0,0 +1,21 @@ +node_modules +workbench +*.log +# Xcode +.DS_Store +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +*.xcworkspace +!default.xcworkspace +xcuserdata +profile +*.moved-aside +DerivedData +.idea/ diff --git a/README.md b/README.md index 7c6b9f4..668675c 100644 --- a/README.md +++ b/README.md @@ -1 +1,6 @@ # RnImageResizer + + +## iOS + +You need to add `RNImageResizer.xcodeproj` to **Libraries** and add `libRNImageResizer.a` to **Link Binary With Libraries** under **Build Phases**. [More info and screenshots about how to do this is available in the React Native documentation](http://facebook.github.io/react-native/docs/linking-libraries-ios.html#content). diff --git a/RNImageResizer.xcodeproj/project.pbxproj b/RNImageResizer.xcodeproj/project.pbxproj new file mode 100644 index 0000000..77accad --- /dev/null +++ b/RNImageResizer.xcodeproj/project.pbxproj @@ -0,0 +1,274 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 17C2CB6A1C0F979D00A087DF /* RNImageResizer.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 17C2CB691C0F979D00A087DF /* RNImageResizer.h */; }; + 17C2CB6C1C0F979D00A087DF /* RNImageResizer.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C2CB6B1C0F979D00A087DF /* RNImageResizer.m */; }; + 17C2CB8B1C0F9C0F00A087DF /* ImageHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C2CB891C0F9C0F00A087DF /* ImageHelpers.m */; }; + 17C2CB8C1C0F9C0F00A087DF /* ImageResizerModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C2CB8A1C0F9C0F00A087DF /* ImageResizerModule.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 17C2CB641C0F979D00A087DF /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + 17C2CB6A1C0F979D00A087DF /* RNImageResizer.h in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 17C2CB661C0F979D00A087DF /* libRNImageResizer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNImageResizer.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 17C2CB691C0F979D00A087DF /* RNImageResizer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNImageResizer.h; sourceTree = ""; }; + 17C2CB6B1C0F979D00A087DF /* RNImageResizer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNImageResizer.m; sourceTree = ""; }; + 17C2CB881C0F9C0F00A087DF /* ImageHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageHelpers.h; sourceTree = ""; }; + 17C2CB891C0F9C0F00A087DF /* ImageHelpers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageHelpers.m; sourceTree = ""; }; + 17C2CB8A1C0F9C0F00A087DF /* ImageResizerModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageResizerModule.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 17C2CB631C0F979D00A087DF /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 17C2CB5D1C0F979D00A087DF = { + isa = PBXGroup; + children = ( + 17C2CB681C0F979D00A087DF /* RNImageResizer */, + 17C2CB671C0F979D00A087DF /* Products */, + ); + sourceTree = ""; + }; + 17C2CB671C0F979D00A087DF /* Products */ = { + isa = PBXGroup; + children = ( + 17C2CB661C0F979D00A087DF /* libRNImageResizer.a */, + ); + name = Products; + sourceTree = ""; + }; + 17C2CB681C0F979D00A087DF /* RNImageResizer */ = { + isa = PBXGroup; + children = ( + 17C2CB881C0F9C0F00A087DF /* ImageHelpers.h */, + 17C2CB891C0F9C0F00A087DF /* ImageHelpers.m */, + 17C2CB8A1C0F9C0F00A087DF /* ImageResizerModule.m */, + 17C2CB691C0F979D00A087DF /* RNImageResizer.h */, + 17C2CB6B1C0F979D00A087DF /* RNImageResizer.m */, + ); + path = RNImageResizer; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 17C2CB651C0F979D00A087DF /* RNImageResizer */ = { + isa = PBXNativeTarget; + buildConfigurationList = 17C2CB6F1C0F979D00A087DF /* Build configuration list for PBXNativeTarget "RNImageResizer" */; + buildPhases = ( + 17C2CB621C0F979D00A087DF /* Sources */, + 17C2CB631C0F979D00A087DF /* Frameworks */, + 17C2CB641C0F979D00A087DF /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = RNImageResizer; + productName = RNImageResizer; + productReference = 17C2CB661C0F979D00A087DF /* libRNImageResizer.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 17C2CB5E1C0F979D00A087DF /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0710; + ORGANIZATIONNAME = BAM; + TargetAttributes = { + 17C2CB651C0F979D00A087DF = { + CreatedOnToolsVersion = 7.1.1; + }; + }; + }; + buildConfigurationList = 17C2CB611C0F979D00A087DF /* Build configuration list for PBXProject "RNImageResizer" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 17C2CB5D1C0F979D00A087DF; + productRefGroup = 17C2CB671C0F979D00A087DF /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 17C2CB651C0F979D00A087DF /* RNImageResizer */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 17C2CB621C0F979D00A087DF /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 17C2CB6C1C0F979D00A087DF /* RNImageResizer.m in Sources */, + 17C2CB8B1C0F9C0F00A087DF /* ImageHelpers.m in Sources */, + 17C2CB8C1C0F9C0F00A087DF /* ImageResizerModule.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 17C2CB6D1C0F979D00A087DF /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 17C2CB6E1C0F979D00A087DF /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 17C2CB701C0F979D00A087DF /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/../../React/**", + "$(SRCROOT)/../react-native/React/**", + "$(SRCROOT)/node_modules/react-native/React/**", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 17C2CB711C0F979D00A087DF /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/../../React/**", + "$(SRCROOT)/../react-native/React/**", + "$(SRCROOT)/node_modules/react-native/React/**", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 17C2CB611C0F979D00A087DF /* Build configuration list for PBXProject "RNImageResizer" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 17C2CB6D1C0F979D00A087DF /* Debug */, + 17C2CB6E1C0F979D00A087DF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 17C2CB6F1C0F979D00A087DF /* Build configuration list for PBXNativeTarget "RNImageResizer" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 17C2CB701C0F979D00A087DF /* Debug */, + 17C2CB711C0F979D00A087DF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 17C2CB5E1C0F979D00A087DF /* Project object */; +} diff --git a/RNImageResizer.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/RNImageResizer.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..0553590 --- /dev/null +++ b/RNImageResizer.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/RNImageResizer.xcodeproj/project.xcworkspace/xcshareddata/RNImageResizer.xcscmblueprint b/RNImageResizer.xcodeproj/project.xcworkspace/xcshareddata/RNImageResizer.xcscmblueprint new file mode 100644 index 0000000..999c841 --- /dev/null +++ b/RNImageResizer.xcodeproj/project.xcworkspace/xcshareddata/RNImageResizer.xcscmblueprint @@ -0,0 +1,30 @@ +{ + "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "0D109C37DD8764732D9148B2C1B21C765B61E85B", + "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { + + }, + "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { + "0D109C37DD8764732D9148B2C1B21C765B61E85B" : 0, + "44AB18E9006B644ECA9DE92549E1AE9E7494A12E" : 0 + }, + "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "40E1EF49-C975-4DF2-98BD-DECB0E0D09CA", + "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { + "0D109C37DD8764732D9148B2C1B21C765B61E85B" : "react-native-image-resizer\/", + "44AB18E9006B644ECA9DE92549E1AE9E7494A12E" : ".." + }, + "DVTSourceControlWorkspaceBlueprintNameKey" : "RNImageResizer", + "DVTSourceControlWorkspaceBlueprintVersion" : 204, + "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "RNImageResizer.xcodeproj", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/bamlab\/react-native-image-resizer", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "0D109C37DD8764732D9148B2C1B21C765B61E85B" + }, + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/bamlab\/chooz-it-app", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "44AB18E9006B644ECA9DE92549E1AE9E7494A12E" + } + ] +} \ No newline at end of file diff --git a/RNImageResizer.xcodeproj/project.xcworkspace/xcuserdata/florian.xcuserdatad/UserInterfaceState.xcuserstate b/RNImageResizer.xcodeproj/project.xcworkspace/xcuserdata/florian.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000000000000000000000000000000000000..f2c450795d1b1ebccbc40add336170344af10015 GIT binary patch literal 13381 zcmd5?cYKr8`adIW(v~!%v}w|`*`w*CbO6fe1Oy7UrIZ=d_H7$TlbQikh9{t+R}qno zBD6(t;RX>95#%BWD8q?f#K}fb6!-7Ed6Tw*>h-UmxA}aUyk|b=+0Xa9wJi?2$D5sf z96*2o20Rb}B6${GT8(}>}?F-m~sG2`mGA zAOLZoH;4x&U$x_kac9UT`0{A1nb&!7{KCtO9Gm<6r~W2%ZDagBQSy;3cpXyb0a{`@tb_ z7#s!1zz5(%@Fn;Pd=0(z)JTK0NQd;ufYMMp z%0Ye6Kr{#qMng~usz&2b4H}OopowS_nvABPsc0HEGX7Vsu zLR6HDA~$23*5a}|y`I84uYJ1B%hX%NiV~*5=5u&U>+N2byV6TrJ!LNU*ou*!Nr7QZ zWnB}~%+Lk6#|odbgzbuN{@7Iv@9@D;K`we3&T|RdmQ%si*(J%nq z42*5yCL(DA14(b9ItGSNttbRVpcs^}dQnS{JCT0783$$0bcO&DN2FHqJq>mTGaxG~ zYpjPdD67HYa@%drtRS(TtfH*CCYS4u47<1UM~1DXCCf>7w>G=#eGbNxMderL&0zUH zoyo8_+Zve+H{-G2!ML+3%7?Sh6+J#?&Sd%1LK$-u3IK#uX_}mdsr#c6OhVCs$-cR8fv`L?aU0TIK79VW8BPi zyUXXPvbh_XplTJfX4>=cO2$F;hN%x}-$++oK*K#D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P{RE-?=^-(ntR9%HUBTg|m*#@u9{YIc|(Ft0K{V}8#3qIt7 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RNImageResizer.xcodeproj/xcuserdata/florian.xcuserdatad/xcschemes/xcschememanagement.plist b/RNImageResizer.xcodeproj/xcuserdata/florian.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..296d7a5 --- /dev/null +++ b/RNImageResizer.xcodeproj/xcuserdata/florian.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + RNImageResizer.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 17C2CB651C0F979D00A087DF + + primary + + + + + diff --git a/RNImageResizer/ImageHelpers.h b/RNImageResizer/ImageHelpers.h new file mode 100644 index 0000000..ef3ed18 --- /dev/null +++ b/RNImageResizer/ImageHelpers.h @@ -0,0 +1,58 @@ +/* + File: ImageHelpers.h + + Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple + Inc. ("Apple") in consideration of your agreement to the following + terms, and your use, installation, modification or redistribution of + this Apple software constitutes acceptance of these terms. If you do + not agree with these terms, please do not use, install, modify or + redistribute this Apple software. + + In consideration of your agreement to abide by the following terms, and + subject to these terms, Apple grants you a personal, non-exclusive + license, under Apple's copyrights in this original Apple software (the + "Apple Software"), to use, reproduce, modify and redistribute the Apple + Software, with or without modifications, in source and/or binary forms; + provided that if you redistribute the Apple Software in its entirety and + without modifications, you must retain this notice and the following + text and disclaimers in all such redistributions of the Apple Software. + Neither the name, trademarks, service marks or logos of Apple Inc. may + be used to endorse or promote products derived from the Apple Software + without specific prior written permission from Apple. Except as + expressly stated in this notice, no other rights or licenses, express or + implied, are granted by Apple herein, including but not limited to any + patent rights that may be infringed by your derivative works or by other + works in which the Apple Software may be incorporated. + + The Apple Software is provided by Apple on an "AS IS" basis. APPLE + MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION + THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND + OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. + + IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, + MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED + AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), + STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + Copyright (C) 2009 Apple Inc. All Rights Reserved. + */ + +#include + +extern const CGBitmapInfo kDefaultCGBitmapInfo; +extern const CGBitmapInfo kDefaultCGBitmapInfoNoAlpha; + +float GetScaleForProportionalResize( CGSize theSize, CGSize intoSize, bool onlyScaleDown, bool maximize ); +CGContextRef CreateCGBitmapContextForWidthAndHeight( unsigned int width, unsigned int height, CGColorSpaceRef optionalColorSpace, CGBitmapInfo optionalInfo ); + +CGImageRef CreateCGImageFromUIImageScaled( UIImage* inImage, float scaleFactor ); + +@interface UIImage (scale) +-(UIImage*)scaleToSize:(CGSize)toSize; +@end + diff --git a/RNImageResizer/ImageHelpers.m b/RNImageResizer/ImageHelpers.m new file mode 100644 index 0000000..9fc52d2 --- /dev/null +++ b/RNImageResizer/ImageHelpers.m @@ -0,0 +1,180 @@ +/* + File: ImageHelpers.m + + Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple + Inc. ("Apple") in consideration of your agreement to the following + terms, and your use, installation, modification or redistribution of + this Apple software constitutes acceptance of these terms. If you do + not agree with these terms, please do not use, install, modify or + redistribute this Apple software. + + In consideration of your agreement to abide by the following terms, and + subject to these terms, Apple grants you a personal, non-exclusive + license, under Apple's copyrights in this original Apple software (the + "Apple Software"), to use, reproduce, modify and redistribute the Apple + Software, with or without modifications, in source and/or binary forms; + provided that if you redistribute the Apple Software in its entirety and + without modifications, you must retain this notice and the following + text and disclaimers in all such redistributions of the Apple Software. + Neither the name, trademarks, service marks or logos of Apple Inc. may + be used to endorse or promote products derived from the Apple Software + without specific prior written permission from Apple. Except as + expressly stated in this notice, no other rights or licenses, express or + implied, are granted by Apple herein, including but not limited to any + patent rights that may be infringed by your derivative works or by other + works in which the Apple Software may be incorporated. + + The Apple Software is provided by Apple on an "AS IS" basis. APPLE + MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION + THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND + OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. + + IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, + MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED + AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), + STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + Copyright (C) 2009 Apple Inc. All Rights Reserved. + */ + +#include "ImageHelpers.h" + +const CGBitmapInfo kDefaultCGBitmapInfo = (kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host); +const CGBitmapInfo kDefaultCGBitmapInfoNoAlpha = (kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Host); + +CGColorSpaceRef GetDeviceRGBColorSpace() { + static CGColorSpaceRef deviceRGBSpace = NULL; + if( deviceRGBSpace == NULL ) + deviceRGBSpace = CGColorSpaceCreateDeviceRGB(); + return deviceRGBSpace; +} + +float GetScaleForProportionalResize( CGSize theSize, CGSize intoSize, bool onlyScaleDown, bool maximize ) +{ + float sx = theSize.width; + float sy = theSize.height; + float dx = intoSize.width; + float dy = intoSize.height; + float scale = 1; + + if( sx != 0 && sy != 0 ) + { + dx = dx / sx; + dy = dy / sy; + + // if maximize is true, take LARGER of the scales, else smaller + if( maximize ) scale = (dx > dy) ? dx : dy; + else scale = (dx < dy) ? dx : dy; + + if( scale > 1 && onlyScaleDown ) // reset scale + scale = 1; + } + else + { + scale = 0; + } + return scale; +} + +CGContextRef CreateCGBitmapContextForWidthAndHeight( unsigned int width, unsigned int height, + CGColorSpaceRef optionalColorSpace, CGBitmapInfo optionalInfo ) +{ + CGColorSpaceRef colorSpace = (optionalColorSpace == NULL) ? GetDeviceRGBColorSpace() : optionalColorSpace; + CGBitmapInfo alphaInfo = ( (int32_t)optionalInfo < 0 ) ? kDefaultCGBitmapInfo : optionalInfo; + return CGBitmapContextCreate( NULL, width, height, 8, 0, colorSpace, alphaInfo ); +} + +CGImageRef CreateCGImageFromUIImageScaled( UIImage* image, float scaleFactor ) +{ + CGImageRef newImage = NULL; + CGContextRef bmContext = NULL; + BOOL mustTransform = YES; + CGAffineTransform transform = CGAffineTransformIdentity; + UIImageOrientation orientation = image.imageOrientation; + + CGImageRef srcCGImage = CGImageRetain( image.CGImage ); + + size_t width = CGImageGetWidth(srcCGImage) * scaleFactor; + size_t height = CGImageGetHeight(srcCGImage) * scaleFactor; + + // These Orientations are rotated 0 or 180 degrees, so they retain the width/height of the image + if( (orientation == UIImageOrientationUp) || (orientation == UIImageOrientationDown) || (orientation == UIImageOrientationUpMirrored) || (orientation == UIImageOrientationDownMirrored) ) + { + bmContext = CreateCGBitmapContextForWidthAndHeight( width, height, NULL, kDefaultCGBitmapInfo ); + } + else // The other Orientations are rotated ±90 degrees, so they swap width & height. + { + bmContext = CreateCGBitmapContextForWidthAndHeight( height, width, NULL, kDefaultCGBitmapInfo ); + } + + //CGContextSetInterpolationQuality( bmContext, kCGInterpolationLow ); + CGContextSetBlendMode( bmContext, kCGBlendModeCopy ); // we just want to copy the data + + switch(orientation) + { + case UIImageOrientationDown: // 0th row is at the bottom, and 0th column is on the right - Rotate 180 degrees + transform = CGAffineTransformMake(-1.0, 0.0, 0.0, -1.0, width, height); + break; + + case UIImageOrientationLeft: // 0th row is on the left, and 0th column is the bottom - Rotate -90 degrees + transform = CGAffineTransformMake(0.0, 1.0, -1.0, 0.0, height, 0.0); + break; + + case UIImageOrientationRight: // 0th row is on the right, and 0th column is the top - Rotate 90 degrees + transform = CGAffineTransformMake(0.0, -1.0, 1.0, 0.0, 0.0, width); + break; + + case UIImageOrientationUpMirrored: // 0th row is at the top, and 0th column is on the right - Flip Horizontal + transform = CGAffineTransformMake(-1.0, 0.0, 0.0, 1.0, width, 0.0); + break; + + case UIImageOrientationDownMirrored: // 0th row is at the bottom, and 0th column is on the left - Flip Vertical + transform = CGAffineTransformMake(1.0, 0.0, 0, -1.0, 0.0, height); + break; + + case UIImageOrientationLeftMirrored: // 0th row is on the left, and 0th column is the top - Rotate -90 degrees and Flip Vertical + transform = CGAffineTransformMake(0.0, -1.0, -1.0, 0.0, height, width); + break; + + case UIImageOrientationRightMirrored: // 0th row is on the right, and 0th column is the bottom - Rotate 90 degrees and Flip Vertical + transform = CGAffineTransformMake(0.0, 1.0, 1.0, 0.0, 0.0, 0.0); + break; + + default: + mustTransform = NO; + break; + } + + if( mustTransform ) CGContextConcatCTM( bmContext, transform ); + + CGContextDrawImage( bmContext, CGRectMake(0.0, 0.0, width, height), srcCGImage ); + CGImageRelease( srcCGImage ); + newImage = CGBitmapContextCreateImage( bmContext ); + CFRelease( bmContext ); + + return newImage; +} + +@implementation UIImage (scale) + +-(UIImage*) scaleToSize:(CGSize)toSize +{ + UIImage *scaledImg = nil; + float scale = GetScaleForProportionalResize( self.size, toSize, false, false ); + CGImageRef cgImage = CreateCGImageFromUIImageScaled( self, scale ); + + if( cgImage ) + { + scaledImg = [UIImage imageWithCGImage:cgImage]; // autoreleased + CGImageRelease( cgImage ); + } + return scaledImg; +} + +@end + diff --git a/RNImageResizer/ImageResizerModule.m b/RNImageResizer/ImageResizerModule.m new file mode 100644 index 0000000..ac26a2c --- /dev/null +++ b/RNImageResizer/ImageResizerModule.m @@ -0,0 +1,83 @@ +// +// ImageResize.m +// ChoozItApp +// +// Created by Florian Rival on 19/11/15. +// + +#import +#import "RCTBridgeModule.h" +#include "ImageHelpers.h" + +@interface ImageResizerModule : NSObject +@end + +@implementation ImageResizerModule + +RCT_EXPORT_MODULE(); + +void saveImage(NSString * fullPath, UIImage * image, float quality) +{ + NSData* data = UIImageJPEGRepresentation(image, quality / 100.0); + NSFileManager* fileManager = [NSFileManager defaultManager]; + [fileManager createFileAtPath:fullPath contents:data attributes:nil]; +} + +NSString * generateCacheFilePath(NSString * ext) +{ + NSArray* paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); + NSString* cacheDirectory = [paths firstObject]; + NSString* name = [[NSUUID UUID] UUIDString]; + NSString* fullName = [NSString stringWithFormat:@"%@.%@", name, ext]; + NSString* fullPath = [cacheDirectory stringByAppendingPathComponent:fullName]; + + return fullPath; +} + +RCT_EXPORT_METHOD(createResizedImage:(NSString *)path width:(float)width height:(float)height quality:(float)quality callback:(RCTResponseSenderBlock)callback) +{ + CGSize newSize = CGSizeMake(width, height); + NSString* fullPath = generateCacheFilePath(@".jpg"); + + NSURL* url = [NSURL URLWithString:path]; + if ([[url scheme] isEqualToString:@"assets-library"]) { + ALAssetsLibrary* library = [[ALAssetsLibrary alloc] init]; + + // Ask for the "Asset" for the URL. An asset is a representation of an image in the Photo application. + [library assetForURL:url resultBlock:^(ALAsset *asset) { + // Here, we have the asset, let's retrieve the image from it + CGImageRef imgRef = [[asset defaultRepresentation] fullResolutionImage]; + UIImage * image = [UIImage imageWithCGImage:imgRef]; + + //Do the resizing + UIImage * scaledImage = [image scaleToSize:newSize]; + if (scaledImage == nil) { + callback(@[@"Can't resize the image.", @""]); + return; + } + + saveImage(fullPath, scaledImage, quality); + callback(@[[NSNull null], fullPath]); + } failureBlock:^(NSError *error) { + callback(@[@"Can't retrieve the file from assets library.", @""]); + }]; + } else { + //Get the image from its path + UIImage* image = [[UIImage alloc] initWithContentsOfFile:path]; + if (image == nil) { + callback(@[@"Can't retrieve the file from the path.", @""]); + return; + } + + //Do the resizing + UIImage * scaledImage = [image scaleToSize:newSize]; + if (scaledImage == nil) { + callback(@[@"Can't resize the image.", @""]); + return; + } + + saveImage(fullPath, scaledImage, quality); + callback(@[[NSNull null], fullPath]); + } +} +@end diff --git a/RNImageResizer/RNImageResizer.h b/RNImageResizer/RNImageResizer.h new file mode 100644 index 0000000..f250681 --- /dev/null +++ b/RNImageResizer/RNImageResizer.h @@ -0,0 +1,13 @@ +// +// RNImageResizer.h +// RNImageResizer +// +// Created by Florian Rival on 02/12/15. +// Copyright © 2015 BAM. All rights reserved. +// + +#import + +@interface RNImageResizer : NSObject + +@end diff --git a/RNImageResizer/RNImageResizer.m b/RNImageResizer/RNImageResizer.m new file mode 100644 index 0000000..c86d84b --- /dev/null +++ b/RNImageResizer/RNImageResizer.m @@ -0,0 +1,13 @@ +// +// RNImageResizer.m +// RNImageResizer +// +// Created by Florian Rival on 02/12/15. +// Copyright © 2015 BAM. All rights reserved. +// + +#import "RNImageResizer.h" + +@implementation RNImageResizer + +@end diff --git a/package.json b/package.json index 8f9276b..8d02c0d 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,7 @@ { - "name": "rn-image-resizer", + "name": "react-native-image-resizer", "version": "0.0.1", "description": "Resize local images with React Native", - "main": "index.android.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, @@ -10,17 +9,22 @@ "react-native", "react", "android", - "camera", - "camera-roll" + "ios", + "images", + "image", + "image-resizer", + "scaling", + "scale", + "resize" ], "repository": { "type": "git", - "url": "git+https://github.com/4ian/rn-image-resizer.git" + "url": "git+https://github.com/4ian/react-native-image-resizer.git" }, "author": "Florian Rival (http://bamlab.fr)", "license": "MIT", "bugs": { - "url": "https://github.com/4ian/rn-image-resizer/issues" + "url": "https://github.com/4ian/react-native-image-resizer/issues" }, - "homepage": "https://github.com/4ian/rn-image-resizer#readme" + "homepage": "https://github.com/4ian/react-native-image-resizer#readme" }