├── .npmignore
├── example
├── .watchmanconfig
├── .gitattributes
├── .babelrc
├── app.json
├── android
│ ├── app
│ │ ├── src
│ │ │ └── main
│ │ │ │ ├── res
│ │ │ │ ├── values
│ │ │ │ │ ├── strings.xml
│ │ │ │ │ └── styles.xml
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ └── mipmap-xxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── java
│ │ │ │ └── com
│ │ │ │ │ └── resizerexample
│ │ │ │ │ ├── MainActivity.java
│ │ │ │ │ └── MainApplication.java
│ │ │ │ └── AndroidManifest.xml
│ │ ├── BUCK
│ │ ├── proguard-rules.pro
│ │ └── build.gradle
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── keystores
│ │ ├── debug.keystore.properties
│ │ └── BUCK
│ ├── settings.gradle
│ ├── build.gradle
│ ├── gradle.properties
│ ├── ResizerExample.iml
│ ├── gradlew.bat
│ └── gradlew
├── .buckconfig
├── index.ios.js
├── index.android.js
├── package.json
├── ios
│ ├── ResizerExample
│ │ ├── AppDelegate.h
│ │ ├── main.m
│ │ ├── Images.xcassets
│ │ │ └── AppIcon.appiconset
│ │ │ │ └── Contents.json
│ │ ├── AppDelegate.m
│ │ ├── Info.plist
│ │ └── Base.lproj
│ │ │ └── LaunchScreen.xib
│ ├── ResizerExampleTests
│ │ ├── Info.plist
│ │ └── ResizerExampleTests.m
│ ├── ResizerExample-tvOSTests
│ │ └── Info.plist
│ ├── ResizerExample-tvOS
│ │ └── Info.plist
│ └── ResizerExample.xcodeproj
│ │ ├── xcshareddata
│ │ └── xcschemes
│ │ │ ├── ResizerExample.xcscheme
│ │ │ └── ResizerExample-tvOS.xcscheme
│ │ └── project.pbxproj
├── README.md
├── .gitignore
├── .flowconfig
└── app.js
├── ios
├── RCTImageResizer
│ ├── RCTImageResizer.h
│ ├── ImageHelpers.h
│ ├── RCTImageResizer.m
│ └── ImageHelpers.m
└── RCTImageResizer.xcodeproj
│ └── project.pbxproj
├── android
├── src
│ └── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── fr
│ │ └── bamlab
│ │ └── rnimageresizer
│ │ ├── ImageResizerPackage.java
│ │ ├── ImageResizerModule.java
│ │ └── ImageResizer.java
└── build.gradle
├── index.android.js
├── index.js.flow
├── index.d.ts
├── index.ios.js
├── react-native-image-resizer.podspec
├── .gitignore
├── package.json
├── docs
└── android_manual_config.md
├── LICENSE
└── README.md
/.npmignore:
--------------------------------------------------------------------------------
1 | example
2 |
--------------------------------------------------------------------------------
/example/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/example/.gitattributes:
--------------------------------------------------------------------------------
1 | *.pbxproj -text
2 |
--------------------------------------------------------------------------------
/example/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["react-native"]
3 | }
--------------------------------------------------------------------------------
/example/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ResizerExample",
3 | "displayName": "ResizerExample"
4 | }
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | ResizerExample
3 |
4 |
--------------------------------------------------------------------------------
/ios/RCTImageResizer/RCTImageResizer.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | @interface ImageResizer : NSObject
4 |
5 | @end
6 |
--------------------------------------------------------------------------------
/example/.buckconfig:
--------------------------------------------------------------------------------
1 |
2 | [android]
3 | target = Google Inc.:Google APIs:23
4 |
5 | [maven_repositories]
6 | central = https://repo1.maven.org/maven2
7 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naxel/react-native-image-resizer/HEAD/example/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/example/android/keystores/debug.keystore.properties:
--------------------------------------------------------------------------------
1 | key.store=debug.keystore
2 | key.alias=androiddebugkey
3 | key.store.password=android
4 | key.alias.password=android
5 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naxel/react-native-image-resizer/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naxel/react-native-image-resizer/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naxel/react-native-image-resizer/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naxel/react-native-image-resizer/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/keystores/BUCK:
--------------------------------------------------------------------------------
1 | keystore(
2 | name = 'debug',
3 | store = 'debug.keystore',
4 | properties = 'debug.keystore.properties',
5 | visibility = [
6 | 'PUBLIC',
7 | ],
8 | )
9 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
6 |
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'ResizerExample'
2 | include ':react-native-image-resizer'
3 | project(':react-native-image-resizer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-resizer/android')
4 |
5 | include ':app'
6 |
--------------------------------------------------------------------------------
/example/index.ios.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Sample React Native App
3 | * https://github.com/facebook/react-native
4 | * @flow
5 | */
6 |
7 | import React, { Component } from 'react';
8 | import {
9 | AppRegistry,
10 | } from 'react-native';
11 | import ResizerExample from './app';
12 |
13 | AppRegistry.registerComponent('ResizerExample', () => ResizerExample);
14 |
--------------------------------------------------------------------------------
/example/index.android.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Sample React Native App
3 | * https://github.com/facebook/react-native
4 | * @flow
5 | */
6 |
7 | import React, { Component } from 'react';
8 | import {
9 | AppRegistry,
10 | } from 'react-native';
11 | import ResizerExample from './app';
12 |
13 | AppRegistry.registerComponent('ResizerExample', () => ResizerExample);
14 |
--------------------------------------------------------------------------------
/example/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ResizerExample",
3 | "version": "0.0.1",
4 | "private": true,
5 | "scripts": {
6 | "start": "node node_modules/react-native/local-cli/cli.js start"
7 | },
8 | "dependencies": {
9 | "react": "^15.4.0",
10 | "react-native": "^0.41.0",
11 | "react-native-gifted-spinner": "^0.1.0",
12 | "react-native-image-resizer": "file:../"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/com/resizerexample/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.resizerexample;
2 |
3 | import com.facebook.react.ReactActivity;
4 |
5 | public class MainActivity extends ReactActivity {
6 |
7 | /**
8 | * Returns the name of the main component registered from JavaScript.
9 | * This is used to schedule rendering of the component.
10 | */
11 | @Override
12 | protected String getMainComponentName() {
13 | return "ResizerExample";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/index.android.js:
--------------------------------------------------------------------------------
1 | import React from 'react-native';
2 |
3 | const ImageResizerAndroid = React.NativeModules.ImageResizerAndroid;
4 |
5 | export default {
6 | createResizedImage: (imagePath, newWidth, newHeight, compressFormat, quality, rotation = 0, outputPath) => {
7 | return new Promise((resolve, reject) => {
8 | ImageResizerAndroid.createResizedImage(imagePath, newWidth, newHeight,
9 | compressFormat, quality, rotation, outputPath, resolve, reject);
10 | });
11 | },
12 | };
13 |
--------------------------------------------------------------------------------
/index.js.flow:
--------------------------------------------------------------------------------
1 | // @flow
2 | declare type ResizedImageInfo = {
3 | path: string,
4 | uri: string,
5 | size?: number,
6 | name?: string
7 | };
8 |
9 | declare function createResizedImage(
10 | uri: string,
11 | width: number,
12 | height: number,
13 | format: 'PNG' | 'JPEG' | 'WEBP',
14 | quality: number,
15 | rotation?: number,
16 | outputPath?: string
17 | ): Promise;
18 |
19 | declare export default {
20 | createResizedImage: createResizedImage
21 | };
22 |
--------------------------------------------------------------------------------
/index.d.ts:
--------------------------------------------------------------------------------
1 | declare module "react-native-image-resizer" {
2 | export interface Response {
3 | path: string;
4 | uri: string;
5 | size?: number;
6 | name?: string;
7 | }
8 |
9 | export default class ImageResizer {
10 | static createResizedImage(
11 | uri: string, width: number, height: number,
12 | format: "PNG" | "JPEG" | "WEBP", quality: number,
13 | rotation?: number, outputPath?: string
14 | ): Promise;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/example/ios/ResizerExample/AppDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @interface AppDelegate : UIResponder
13 |
14 | @property (nonatomic, strong) UIWindow *window;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/example/ios/ResizerExample/main.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import "AppDelegate.h"
13 |
14 | int main(int argc, char * argv[]) {
15 | @autoreleasepool {
16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/index.ios.js:
--------------------------------------------------------------------------------
1 | import {
2 | NativeModules,
3 | } from 'react-native';
4 |
5 | export default {
6 | createResizedImage: (path, width, height, format, quality, rotation = 0, outputPath) => {
7 | if (format !== 'JPEG' && format !== 'PNG') {
8 | throw new Error('Only JPEG and PNG format are supported by createResizedImage');
9 | }
10 |
11 | return new Promise((resolve, reject) => {
12 | NativeModules.ImageResizer.createResizedImage(path, width, height, format, quality, rotation, outputPath, (err, response) => {
13 | if (err) {
14 | return reject(err);
15 | }
16 |
17 | resolve(response);
18 | });
19 | });
20 | },
21 | };
22 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | jcenter()
4 | }
5 |
6 |
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.2.3'
9 | }
10 | }
11 |
12 | apply plugin: 'com.android.library'
13 |
14 | android {
15 | compileSdkVersion 25
16 | buildToolsVersion "25.0.3"
17 |
18 | defaultConfig {
19 | minSdkVersion 16
20 | targetSdkVersion 23
21 | versionCode 1
22 | versionName "1.0"
23 | }
24 | buildTypes {
25 | release {
26 | minifyEnabled false
27 | }
28 | }
29 | }
30 |
31 | repositories {
32 | mavenCentral()
33 | }
34 |
35 | dependencies {
36 | compile 'com.facebook.react:react-native:+'
37 | }
38 |
--------------------------------------------------------------------------------
/react-native-image-resizer.podspec:
--------------------------------------------------------------------------------
1 | require 'json'
2 |
3 | package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4 |
5 | Pod::Spec.new do |s|
6 | s.name = "react-native-image-resizer"
7 | s.version = package['version']
8 | s.summary = package['description']
9 | s.homepage = "https://github.com/bamlab/react-native-image-resizer"
10 | s.license = package['license']
11 | s.author = package['author']
12 | s.source = { :git => "https://github.com/bamlab/react-native-image-resizer.git", :tag => "v#{s.version}" }
13 |
14 | s.platform = :ios, "8.0"
15 |
16 | s.preserve_paths = 'README.md', 'LICENSE', 'package.json', 'index.js'
17 | s.source_files = "ios/RCTImageResizer/*.{h,m}"
18 |
19 | s.dependency 'React'
20 | end
21 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:1.3.1'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | mavenLocal()
18 | jcenter()
19 | maven {
20 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
21 | url "$rootDir/../node_modules/react-native/android"
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/example/ios/ResizerExample/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 | # `react-native-image-resizer` example
2 |
3 | This is a very simple example app, loading the first photo from the device camera roll
4 | and allowing to resize it.
5 |
6 | ## Installation
7 |
8 | Be sure to have React Native installed.
9 |
10 | ```bash
11 | cd example
12 | yarn #or npm install
13 | ```
14 |
15 | ### iOS
16 |
17 | ```
18 | react-native run-ios
19 | ```
20 |
21 | ### Android
22 |
23 | ```
24 | react-native run-android
25 | ```
26 |
27 | ## Development
28 |
29 | If you want to use this sample app to develop `react-native-image-resizer`, erase the `node_modules/react-native-image-resizer` folder and replace it by the git repository:
30 |
31 | ```bash
32 | rm -rf node_modules/react-native-image-resizer
33 | cd node_modules && git clone git@github.com:bamlab/react-native-image-resizer.git
34 | ```
35 |
36 | Recompile and relaunch iOS/Android apps.
37 |
--------------------------------------------------------------------------------
/example/ios/ResizerExampleTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/example/ios/ResizerExample-tvOSTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
19 |
20 | android.useDeprecatedNdk=true
21 |
--------------------------------------------------------------------------------
/example/android/ResizerExample.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | #
3 | .DS_Store
4 |
5 | # Xcode
6 | #
7 | build/
8 | *.pbxuser
9 | !default.pbxuser
10 | *.mode1v3
11 | !default.mode1v3
12 | *.mode2v3
13 | !default.mode2v3
14 | *.perspectivev3
15 | !default.perspectivev3
16 | xcuserdata
17 | *.xccheckout
18 | *.moved-aside
19 | DerivedData
20 | *.hmap
21 | *.ipa
22 | *.xcuserstate
23 | project.xcworkspace
24 |
25 | # Android/IntelliJ
26 | #
27 | build/
28 | .idea
29 | .gradle
30 | local.properties
31 | *.iml
32 |
33 | # node.js
34 | #
35 | node_modules/
36 | npm-debug.log
37 | yarn-error.log
38 |
39 | # BUCK
40 | buck-out/
41 | \.buckd/
42 | android/app/libs
43 | *.keystore
44 |
45 | # fastlane
46 | #
47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
48 | # screenshots whenever they are needed.
49 | # For more information about the recommended setup visit:
50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
51 |
52 | fastlane/report.xml
53 | fastlane/Preview.html
54 | fastlane/screenshots
55 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | #
3 | .DS_Store
4 |
5 | # Xcode
6 | #
7 | build/
8 | *.pbxuser
9 | !default.pbxuser
10 | *.mode1v3
11 | !default.mode1v3
12 | *.mode2v3
13 | !default.mode2v3
14 | *.perspectivev3
15 | !default.perspectivev3
16 | xcuserdata
17 | *.xccheckout
18 | *.moved-aside
19 | DerivedData
20 | *.hmap
21 | *.ipa
22 | *.xcuserstate
23 | project.xcworkspace
24 |
25 | # Android/IntelliJ
26 | #
27 | build/
28 | .idea
29 | .gradle
30 | local.properties
31 | *.iml
32 |
33 | # node.js
34 | #
35 | node_modules/
36 | npm-debug.log
37 |
38 | # BUCK
39 | buck-out/
40 | \.buckd/
41 | android/app/libs
42 | *.keystore
43 |
44 | # fastlane
45 | #
46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
47 | # screenshots whenever they are needed.
48 | # For more information about the recommended setup visit:
49 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
50 |
51 | fastlane/report.xml
52 | fastlane/Preview.html
53 | fastlane/screenshots
54 |
55 |
56 | # APK
57 | android/app/*.apk
58 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-native-image-resizer",
3 | "version": "1.0.0",
4 | "description": "Rescale local images with React Native",
5 | "repository": {
6 | "type": "git",
7 | "url": "git+https://github.com/4ian/react-native-image-resizer.git"
8 | },
9 | "keywords": [
10 | "react-native",
11 | "react",
12 | "android",
13 | "ios",
14 | "images",
15 | "image",
16 | "image-resizer",
17 | "scaling",
18 | "scale",
19 | "resize"
20 | ],
21 | "peerDependencies": {
22 | "react": "^15.4.0 || ^16.0.0-alpha",
23 | "react-native": ">=v0.40.0"
24 | },
25 | "author": "Florian Rival (http://bam.tech)",
26 | "license": "MIT",
27 | "bugs": {
28 | "url": "https://github.com/4ian/react-native-image-resizer/issues"
29 | },
30 | "homepage": "https://github.com/4ian/react-native-image-resizer#readme",
31 | "devDependencies": {
32 | "cz-conventional-changelog": "^1.2.0"
33 | },
34 | "config": {
35 | "commitizen": {
36 | "path": "./node_modules/cz-conventional-changelog"
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/docs/android_manual_config.md:
--------------------------------------------------------------------------------
1 | #### Manual linking
2 | If your any reason you don want to link this project using 'react-native link', go to settings.gradle and add
3 | ```
4 | include ':react-native-image-resizer'
5 | project(':react-native-image-resizer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-resizer/android')
6 | ```
7 | then go the file that you build the ReactInstance and add the packager to it.
8 |
9 | ```
10 | ReactInstanceManager.Builder builder = ReactInstanceManager.builder()
11 | .setApplication(application)
12 | .setDefaultHardwareBackBtnHandler(application.getGAMActivity())
13 | .setInitialLifecycleState(LifecycleState.RESUMED)
14 | .setCurrentActivity((Activity) application.getGAMActivity())
15 | .addPackage(new RealmReactPackage())
16 | .addPackage(new MainReactPackageWrapper())
17 | .addPackage(new StoreReactNativePackage())
18 | .addPackage(new ImageResizerPackage()) <------- (Add this package on the Builder list)
19 | .addPackage(gamCommunicationReactPackage);
20 | ```
21 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Florian Rival and Alexandre Moureaux
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
12 |
13 |
19 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/com/resizerexample/MainApplication.java:
--------------------------------------------------------------------------------
1 | package com.resizerexample;
2 |
3 | import android.app.Application;
4 | import android.util.Log;
5 |
6 | import com.facebook.react.ReactApplication;
7 | import fr.bamlab.rnimageresizer.ImageResizerPackage;
8 | import com.facebook.react.ReactInstanceManager;
9 | import com.facebook.react.ReactNativeHost;
10 | import com.facebook.react.ReactPackage;
11 | import com.facebook.react.shell.MainReactPackage;
12 | import com.facebook.soloader.SoLoader;
13 |
14 | import java.util.Arrays;
15 | import java.util.List;
16 |
17 | public class MainApplication extends Application implements ReactApplication {
18 |
19 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
20 | @Override
21 | public boolean getUseDeveloperSupport() {
22 | return BuildConfig.DEBUG;
23 | }
24 |
25 | @Override
26 | protected List getPackages() {
27 | return Arrays.asList(
28 | new MainReactPackage(),
29 | new ImageResizerPackage()
30 | );
31 | }
32 | };
33 |
34 | @Override
35 | public ReactNativeHost getReactNativeHost() {
36 | return mReactNativeHost;
37 | }
38 |
39 | @Override
40 | public void onCreate() {
41 | super.onCreate();
42 | SoLoader.init(this, /* native exopackage */ false);
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/example/.flowconfig:
--------------------------------------------------------------------------------
1 | [ignore]
2 | ; We fork some components by platform
3 | .*/*[.]android.js
4 |
5 | ; Ignore "BUCK" generated dirs
6 | /\.buckd/
7 |
8 | ; Ignore unexpected extra "@providesModule"
9 | .*/node_modules/.*/node_modules/fbjs/.*
10 |
11 | ; Ignore duplicate module providers
12 | ; For RN Apps installed via npm, "Libraries" folder is inside
13 | ; "node_modules/react-native" but in the source repo it is in the root
14 | .*/Libraries/react-native/React.js
15 | .*/Libraries/react-native/ReactNative.js
16 |
17 | [include]
18 |
19 | [libs]
20 | node_modules/react-native/Libraries/react-native/react-native-interface.js
21 | node_modules/react-native/flow
22 | flow/
23 |
24 | [options]
25 | module.system=haste
26 |
27 | experimental.strict_type_args=true
28 |
29 | munge_underscores=true
30 |
31 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
32 |
33 | suppress_type=$FlowIssue
34 | suppress_type=$FlowFixMe
35 | suppress_type=$FixMe
36 |
37 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-7]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
38 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-7]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
39 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
40 |
41 | unsafe.enable_getters_and_setters=true
42 |
43 | [version]
44 | ^0.37.0
45 |
--------------------------------------------------------------------------------
/example/ios/ResizerExample/AppDelegate.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "AppDelegate.h"
11 |
12 | #import
13 | #import
14 |
15 | @implementation AppDelegate
16 |
17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
18 | {
19 | NSURL *jsCodeLocation;
20 |
21 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
22 |
23 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
24 | moduleName:@"ResizerExample"
25 | initialProperties:nil
26 | launchOptions:launchOptions];
27 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
28 |
29 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
30 | UIViewController *rootViewController = [UIViewController new];
31 | rootViewController.view = rootView;
32 | self.window.rootViewController = rootViewController;
33 | [self.window makeKeyAndVisible];
34 | return YES;
35 | }
36 |
37 | @end
38 |
--------------------------------------------------------------------------------
/example/android/app/BUCK:
--------------------------------------------------------------------------------
1 | import re
2 |
3 | # To learn about Buck see [Docs](https://buckbuild.com/).
4 | # To run your application with Buck:
5 | # - install Buck
6 | # - `npm start` - to start the packager
7 | # - `cd android`
8 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
9 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
10 | # - `buck install -r android/app` - compile, install and run application
11 | #
12 |
13 | lib_deps = []
14 | for jarfile in glob(['libs/*.jar']):
15 | name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile)
16 | lib_deps.append(':' + name)
17 | prebuilt_jar(
18 | name = name,
19 | binary_jar = jarfile,
20 | )
21 |
22 | for aarfile in glob(['libs/*.aar']):
23 | name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile)
24 | lib_deps.append(':' + name)
25 | android_prebuilt_aar(
26 | name = name,
27 | aar = aarfile,
28 | )
29 |
30 | android_library(
31 | name = 'all-libs',
32 | exported_deps = lib_deps
33 | )
34 |
35 | android_library(
36 | name = 'app-code',
37 | srcs = glob([
38 | 'src/main/java/**/*.java',
39 | ]),
40 | deps = [
41 | ':all-libs',
42 | ':build_config',
43 | ':res',
44 | ],
45 | )
46 |
47 | android_build_config(
48 | name = 'build_config',
49 | package = 'com.resizerexample',
50 | )
51 |
52 | android_resource(
53 | name = 'res',
54 | res = 'src/main/res',
55 | package = 'com.resizerexample',
56 | )
57 |
58 | android_binary(
59 | name = 'app',
60 | package_type = 'debug',
61 | manifest = 'src/main/AndroidManifest.xml',
62 | keystore = '//android/keystores:debug',
63 | deps = [
64 | ':app-code',
65 | ],
66 | )
67 |
--------------------------------------------------------------------------------
/example/ios/ResizerExample-tvOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UIViewControllerBasedStatusBarAppearance
38 |
39 | NSLocationWhenInUseUsageDescription
40 |
41 | NSAppTransportSecurity
42 |
43 |
44 | NSExceptionDomains
45 |
46 | localhost
47 |
48 | NSExceptionAllowsInsecureHTTPLoads
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/example/ios/ResizerExample/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | NSPhotoLibraryUsageDescription
6 | This example uses the latest photo from the photo library
7 | CFBundleDevelopmentRegion
8 | en
9 | CFBundleDisplayName
10 | ResizerExample
11 | CFBundleExecutable
12 | $(EXECUTABLE_NAME)
13 | CFBundleIdentifier
14 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)
15 | CFBundleInfoDictionaryVersion
16 | 6.0
17 | CFBundleName
18 | $(PRODUCT_NAME)
19 | CFBundlePackageType
20 | APPL
21 | CFBundleShortVersionString
22 | 1.0
23 | CFBundleSignature
24 | ????
25 | CFBundleVersion
26 | 1
27 | LSRequiresIPhoneOS
28 |
29 | UILaunchStoryboardName
30 | LaunchScreen
31 | UIRequiredDeviceCapabilities
32 |
33 | armv7
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationLandscapeLeft
39 | UIInterfaceOrientationLandscapeRight
40 |
41 | UIViewControllerBasedStatusBarAppearance
42 |
43 | NSLocationWhenInUseUsageDescription
44 |
45 | NSAppTransportSecurity
46 |
47 | NSExceptionDomains
48 |
49 | localhost
50 |
51 | NSExceptionAllowsInsecureHTTPLoads
52 |
53 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/android/src/main/java/fr/bamlab/rnimageresizer/ImageResizerPackage.java:
--------------------------------------------------------------------------------
1 | package fr.bamlab.rnimageresizer;
2 |
3 | import com.facebook.react.ReactPackage;
4 | import com.facebook.react.bridge.JavaScriptModule;
5 | import com.facebook.react.bridge.NativeModule;
6 | import com.facebook.react.bridge.ReactApplicationContext;
7 | import com.facebook.react.uimanager.ViewManager;
8 |
9 | import java.util.ArrayList;
10 | import java.util.Collections;
11 | import java.util.List;
12 |
13 | /**
14 | * Created by almouro on 19/11/15.
15 | */
16 | public class ImageResizerPackage implements ReactPackage {
17 | /**
18 | * @param reactContext react application context that can be used to create modules
19 | * @return list of native modules to register with the newly created catalyst instance
20 | */
21 | @Override
22 | public List createNativeModules(ReactApplicationContext reactContext) {
23 | List modules = new ArrayList<>();
24 | modules.add(new ImageResizerModule(reactContext));
25 |
26 | return modules;
27 | }
28 |
29 | /**
30 | * @return list of JS modules to register with the newly created catalyst instance.
31 | *
32 | * IMPORTANT: Note that only modules that needs to be accessible from the native code should be
33 | * listed here. Also listing a native module here doesn't imply that the JS implementation of it
34 | * will be automatically included in the JS bundle.
35 | */
36 | // Deprecated from RN 0.47.0
37 | public List> createJSModules() {
38 | return Collections.emptyList();
39 | }
40 |
41 | /**
42 | * @param reactContext
43 | * @return a list of view managers that should be registered with {@link UIManagerModule}
44 | */
45 | @Override
46 | public List createViewManagers(ReactApplicationContext reactContext) {
47 | return Collections.emptyList();
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/example/ios/ResizerExampleTests/ResizerExampleTests.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 | #import
12 |
13 | #import
14 | #import
15 |
16 | #define TIMEOUT_SECONDS 600
17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!"
18 |
19 | @interface ResizerExampleTests : XCTestCase
20 |
21 | @end
22 |
23 | @implementation ResizerExampleTests
24 |
25 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test
26 | {
27 | if (test(view)) {
28 | return YES;
29 | }
30 | for (UIView *subview in [view subviews]) {
31 | if ([self findSubviewInView:subview matching:test]) {
32 | return YES;
33 | }
34 | }
35 | return NO;
36 | }
37 |
38 | - (void)testRendersWelcomeScreen
39 | {
40 | UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController];
41 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
42 | BOOL foundElement = NO;
43 |
44 | __block NSString *redboxError = nil;
45 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
46 | if (level >= RCTLogLevelError) {
47 | redboxError = message;
48 | }
49 | });
50 |
51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
54 |
55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {
56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
57 | return YES;
58 | }
59 | return NO;
60 | }];
61 | }
62 |
63 | RCTSetLogFunction(RCTDefaultLogFunction);
64 |
65 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
66 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
67 | }
68 |
69 |
70 | @end
71 |
--------------------------------------------------------------------------------
/example/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Disabling obfuscation is useful if you collect stack traces from production crashes
20 | # (unless you are using a system that supports de-obfuscate the stack traces).
21 | -dontobfuscate
22 |
23 | # React Native
24 |
25 | # Keep our interfaces so they can be used by other ProGuard rules.
26 | # See http://sourceforge.net/p/proguard/bugs/466/
27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
29 | -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
30 |
31 | # Do not strip any method/class that is annotated with @DoNotStrip
32 | -keep @com.facebook.proguard.annotations.DoNotStrip class *
33 | -keep @com.facebook.common.internal.DoNotStrip class *
34 | -keepclassmembers class * {
35 | @com.facebook.proguard.annotations.DoNotStrip *;
36 | @com.facebook.common.internal.DoNotStrip *;
37 | }
38 |
39 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
40 | void set*(***);
41 | *** get*();
42 | }
43 |
44 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
45 | -keep class * extends com.facebook.react.bridge.NativeModule { *; }
46 | -keepclassmembers,includedescriptorclasses class * { native ; }
47 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; }
48 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; }
49 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; }
50 |
51 | -dontwarn com.facebook.react.**
52 |
53 | # okhttp
54 |
55 | -keepattributes Signature
56 | -keepattributes *Annotation*
57 | -keep class okhttp3.** { *; }
58 | -keep interface okhttp3.** { *; }
59 | -dontwarn okhttp3.**
60 |
61 | # okio
62 |
63 | -keep class sun.misc.Unsafe { *; }
64 | -dontwarn java.nio.file.*
65 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
66 | -dontwarn okio.**
67 |
--------------------------------------------------------------------------------
/example/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/android/src/main/java/fr/bamlab/rnimageresizer/ImageResizerModule.java:
--------------------------------------------------------------------------------
1 | package fr.bamlab.rnimageresizer;
2 |
3 | import android.content.Context;
4 | import android.graphics.Bitmap;
5 | import android.net.Uri;
6 |
7 | import com.facebook.react.bridge.Arguments;
8 | import com.facebook.react.bridge.Callback;
9 | import com.facebook.react.bridge.ReactApplicationContext;
10 | import com.facebook.react.bridge.ReactContextBaseJavaModule;
11 | import com.facebook.react.bridge.ReactMethod;
12 | import com.facebook.react.bridge.WritableMap;
13 |
14 | import java.io.File;
15 | import java.io.IOException;
16 |
17 | /**
18 | * Created by almouro on 19/11/15.
19 | */
20 | class ImageResizerModule extends ReactContextBaseJavaModule {
21 | private Context context;
22 |
23 | public ImageResizerModule(ReactApplicationContext reactContext) {
24 | super(reactContext);
25 | this.context = reactContext;
26 | }
27 |
28 | /**
29 | * @return the name of this module. This will be the name used to {@code require()} this module
30 | * from javascript.
31 | */
32 | @Override
33 | public String getName() {
34 | return "ImageResizerAndroid";
35 | }
36 |
37 | @ReactMethod
38 | public void createResizedImage(String imagePath, int newWidth, int newHeight, String compressFormat,
39 | int quality, int rotation, String outputPath, final Callback successCb, final Callback failureCb) {
40 | try {
41 | createResizedImageWithExceptions(imagePath, newWidth, newHeight, compressFormat, quality,
42 | rotation, outputPath, successCb, failureCb);
43 | } catch (IOException e) {
44 | failureCb.invoke(e.getMessage());
45 | }
46 | }
47 |
48 | private void createResizedImageWithExceptions(String imagePath, int newWidth, int newHeight,
49 | String compressFormatString, int quality, int rotation, String outputPath,
50 | final Callback successCb, final Callback failureCb) throws IOException {
51 | Bitmap.CompressFormat compressFormat = Bitmap.CompressFormat.valueOf(compressFormatString);
52 | Uri imageUri = Uri.parse(imagePath);
53 |
54 | File resizedImage = ImageResizer.createResizedImage(this.context, imageUri, newWidth,
55 | newHeight, compressFormat, quality, rotation, outputPath);
56 |
57 | // If resizedImagePath is empty and this wasn't caught earlier, throw.
58 | if (resizedImage.isFile()) {
59 | WritableMap response = Arguments.createMap();
60 | response.putString("path", resizedImage.getAbsolutePath());
61 | response.putString("uri", Uri.fromFile(resizedImage).toString());
62 | response.putString("name", resizedImage.getName());
63 | response.putDouble("size", resizedImage.length());
64 | // Invoke success
65 | successCb.invoke(response);
66 | } else {
67 | failureCb.invoke("Error getting resized image path");
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/ios/RCTImageResizer/ImageHelpers.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: ImageHelpers.h
3 |
4 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
5 | Inc. ("Apple") in consideration of your agreement to the following
6 | terms, and your use, installation, modification or redistribution of
7 | this Apple software constitutes acceptance of these terms. If you do
8 | not agree with these terms, please do not use, install, modify or
9 | redistribute this Apple software.
10 |
11 | In consideration of your agreement to abide by the following terms, and
12 | subject to these terms, Apple grants you a personal, non-exclusive
13 | license, under Apple's copyrights in this original Apple software (the
14 | "Apple Software"), to use, reproduce, modify and redistribute the Apple
15 | Software, with or without modifications, in source and/or binary forms;
16 | provided that if you redistribute the Apple Software in its entirety and
17 | without modifications, you must retain this notice and the following
18 | text and disclaimers in all such redistributions of the Apple Software.
19 | Neither the name, trademarks, service marks or logos of Apple Inc. may
20 | be used to endorse or promote products derived from the Apple Software
21 | without specific prior written permission from Apple. Except as
22 | expressly stated in this notice, no other rights or licenses, express or
23 | implied, are granted by Apple herein, including but not limited to any
24 | patent rights that may be infringed by your derivative works or by other
25 | works in which the Apple Software may be incorporated.
26 |
27 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE
28 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
29 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
30 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
31 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
32 |
33 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
34 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
35 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
36 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
37 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
38 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
39 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
40 | POSSIBILITY OF SUCH DAMAGE.
41 |
42 | Copyright (C) 2009 Apple Inc. All Rights Reserved.
43 | */
44 |
45 | #include
46 |
47 | extern const CGBitmapInfo kDefaultCGBitmapInfo;
48 | extern const CGBitmapInfo kDefaultCGBitmapInfoNoAlpha;
49 |
50 | float GetScaleForProportionalResize( CGSize theSize, CGSize intoSize, bool onlyScaleDown, bool maximize );
51 | CGContextRef CreateCGBitmapContextForWidthAndHeight( unsigned int width, unsigned int height, CGColorSpaceRef optionalColorSpace, CGBitmapInfo optionalInfo );
52 |
53 | CGImageRef CreateCGImageFromUIImageScaled( UIImage* inImage, float scaleFactor );
54 |
55 | @interface UIImage (scale)
56 | -(UIImage*)scaleToSize:(CGSize)toSize;
57 | @end
58 |
--------------------------------------------------------------------------------
/example/app.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Sample React Native App
3 | * https://github.com/facebook/react-native
4 | */
5 |
6 | import React, { Component } from 'react';
7 | import {
8 | AppRegistry,
9 | CameraRoll,
10 | StyleSheet,
11 | Text,
12 | View,
13 | Image,
14 | Alert,
15 | TouchableOpacity
16 | } from 'react-native';
17 | import Spinner from 'react-native-gifted-spinner';
18 | import ImageResizer from 'react-native-image-resizer';
19 |
20 | const styles = StyleSheet.create({
21 | container: {
22 | flex: 1,
23 | justifyContent: 'center',
24 | alignItems: 'center',
25 | backgroundColor: '#F5FCFF',
26 | },
27 | welcome: {
28 | fontSize: 20,
29 | textAlign: 'center',
30 | margin: 10,
31 | },
32 | instructions: {
33 | textAlign: 'center',
34 | color: '#333333',
35 | marginBottom: 5,
36 | },
37 | image: {
38 | width: 250,
39 | height: 250,
40 | },
41 | resizeButton: {
42 | color: '#333333',
43 | fontWeight: 'bold',
44 | marginBottom: 5,
45 | }
46 | });
47 |
48 | export default class ResizerExample extends Component {
49 | constructor() {
50 | super();
51 |
52 | this.state = {
53 | resizedImageUri: '',
54 | loading: true,
55 | };
56 | }
57 |
58 | componentDidMount() {
59 | CameraRoll.getPhotos({first: 1}).then((photos) => {
60 | if (!photos.edges || photos.edges.length === 0) {
61 | return Alert.alert('Unable to load camera roll',
62 | 'Check that you authorized the access to the camera roll photos and that there is at least one photo in it');
63 | }
64 |
65 | this.setState({
66 | image: photos.edges[0].node.image,
67 | })
68 | }).catch(() => {
69 | return Alert.alert('Unable to load camera roll',
70 | 'Check that you authorized the access to the camera roll photos');
71 | });
72 | }
73 |
74 | resize() {
75 | ImageResizer.createResizedImage(this.state.image.uri, 800, 600, 'JPEG', 80)
76 | .then(({uri}) => {
77 | this.setState({
78 | resizedImageUri: uri,
79 | });
80 | }).catch((err) => {
81 | console.log(err);
82 | return Alert.alert('Unable to resize the photo',
83 | 'Check the console for full the error message');
84 | });
85 | }
86 |
87 | render() {
88 | return (
89 |
90 |
91 | Image Resizer example
92 |
93 |
94 | This is the original image:
95 |
96 | {
97 | this.state.image ?
98 | :
99 |
100 | }
101 |
102 | Resized image:
103 |
104 | this.resize()}>
105 |
106 | Click me to resize the image
107 |
108 |
109 | {
110 | this.state.resizedImageUri ?
111 | : null
112 | }
113 |
114 | );
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/example/ios/ResizerExample/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
21 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # React Native Image Resizer
2 |
3 | A React Native module that can create scaled versions of local images (also supports the assets library on iOS).
4 |
5 | ## Setup
6 |
7 | Install the package:
8 |
9 | * 😻 React Native >= 0.40
10 | ```
11 | npm install --save react-native-image-resizer
12 | react-native link react-native-image-resizer
13 | ```
14 |
15 | > ⚠️ **Heads up, breaking change!** If you're upgrading *react-native-image-resizer* to version 1.0.0, please note that the response of `createResizedImage` changed. You must now read the image uri from property `uri` of the returned object. [Here is an example](https://github.com/bamlab/react-native-image-resizer/commit/15ea06d7651faf316b946170427efa90ea48dc4e). Easy, huh?
16 |
17 | ## Older versions:
18 |
19 | * 👨 React Native >= 0.29.2 and < 0.40
20 | ```
21 | npm install --save react-native-image-resizer@0.0.12
22 | react-native link react-native-image-resizer
23 | ```
24 |
25 | * 👴 React Native >= 0.28 and < 0.29.2
26 | ```
27 | npm install rnpm -g
28 | rnpm install react-native-image-resizer@0.0.12
29 | ```
30 |
31 | ### Android
32 |
33 | Note: on latest versions of React Native, you may have an error during the Gradle build on Android (`com.android.dex.DexException: Multiple dex files define Landroid/support/v7/appcompat/R$anim`). Run `cd android && ./gradlew clean` to fix this.
34 |
35 | #### Manual linking
36 | Manual link information for Android: [Link](docs/android_manual_config.md)
37 |
38 | ## Usage example
39 |
40 | ```javascript
41 | import ImageResizer from 'react-native-image-resizer';
42 |
43 | ImageResizer.createResizedImage(imageUri, newWidth, newHeight, compressFormat, quality, rotation, outputPath).then((response) => {
44 | // response.uri is the URI of the new image that can now be displayed, uploaded...
45 | // response.path is the path of the new image
46 | // response.name is the name of the new image with the extension
47 | // response.size is the size of the new image
48 | }).catch((err) => {
49 | // Oops, something went wrong. Check that the filename is correct and
50 | // inspect err to get more details.
51 | });
52 | ```
53 |
54 | ### Sample app
55 |
56 | A basic, sample app is available in [the `example` folder](https://github.com/bamlab/react-native-image-resizer/tree/master/example). It uses the module to resize a photo from the Camera Roll.
57 |
58 | ## API
59 |
60 | ### `promise createResizedImage(path, maxWidth, maxHeight, compressFormat, quality, rotation = 0, outputPath)`
61 |
62 | The promise resolves with an object containing: `path`, `uri`, `name` and `size` of the new file. The URI can be used directly as the `source` of an [``](https://facebook.github.io/react-native/docs/image.html) component.
63 |
64 | Option | Description
65 | ------ | -----------
66 | path | Path of image file, or a base64 encoded image string prefixed with 'data:image/imagetype' where `imagetype` is jpeg or png.
67 | maxWidth | Image max width (ratio is preserved)
68 | maxHeight | Image max height (ratio is preserved)
69 | compressFormat | Can be either JPEG, PNG or WEBP (android only).
70 | quality | A number between 0 and 100. Used for the JPEG compression.
71 | rotation | Rotation to apply to the image, in degrees, for android. On iOS, rotation is limited (and rounded) to multiples of 90 degrees.
72 | outputPath | The resized image path. If null, resized image will be stored in cache folder. To set outputPath make sure to add option for rotation too (if no rotation is needed, just set it to 0).
73 |
74 | ## Other open-source modules by the folks at [BAM](http://github.com/bamlab)
75 |
76 | * [rn-camera-roll](https://github.com/bamlab/rn-camera-roll)
77 | * [react-native-numberpicker-dialog](https://github.com/bamlab/react-native-numberpicker-dialog)
78 | * [react-native-animated-picker](https://github.com/bamlab/react-native-animated-picker)
79 | * [cordova-plugin-native-routing](https://github.com/bamlab/cordova-plugin-native-routing)
80 |
--------------------------------------------------------------------------------
/example/ios/ResizerExample.xcodeproj/xcshareddata/xcschemes/ResizerExample.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
43 |
49 |
50 |
51 |
52 |
53 |
58 |
59 |
61 |
67 |
68 |
69 |
70 |
71 |
77 |
78 |
79 |
80 |
81 |
82 |
92 |
94 |
100 |
101 |
102 |
103 |
104 |
105 |
111 |
113 |
119 |
120 |
121 |
122 |
124 |
125 |
128 |
129 |
130 |
--------------------------------------------------------------------------------
/example/ios/ResizerExample.xcodeproj/xcshareddata/xcschemes/ResizerExample-tvOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
43 |
49 |
50 |
51 |
52 |
53 |
58 |
59 |
61 |
67 |
68 |
69 |
70 |
71 |
77 |
78 |
79 |
80 |
81 |
82 |
92 |
94 |
100 |
101 |
102 |
103 |
104 |
105 |
111 |
113 |
119 |
120 |
121 |
122 |
124 |
125 |
128 |
129 |
130 |
--------------------------------------------------------------------------------
/example/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 |
3 | import com.android.build.OutputFile
4 |
5 | /**
6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
7 | * and bundleReleaseJsAndAssets).
8 | * These basically call `react-native bundle` with the correct arguments during the Android build
9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
10 | * bundle directly from the development server. Below you can see all the possible configurations
11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the
12 | * `apply from: "../../node_modules/react-native/react.gradle"` line.
13 | *
14 | * project.ext.react = [
15 | * // the name of the generated asset file containing your JS bundle
16 | * bundleAssetName: "index.android.bundle",
17 | *
18 | * // the entry file for bundle generation
19 | * entryFile: "index.android.js",
20 | *
21 | * // whether to bundle JS and assets in debug mode
22 | * bundleInDebug: false,
23 | *
24 | * // whether to bundle JS and assets in release mode
25 | * bundleInRelease: true,
26 | *
27 | * // whether to bundle JS and assets in another build variant (if configured).
28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
29 | * // The configuration property can be in the following formats
30 | * // 'bundleIn${productFlavor}${buildType}'
31 | * // 'bundleIn${buildType}'
32 | * // bundleInFreeDebug: true,
33 | * // bundleInPaidRelease: true,
34 | * // bundleInBeta: true,
35 | *
36 | * // the root of your project, i.e. where "package.json" lives
37 | * root: "../../",
38 | *
39 | * // where to put the JS bundle asset in debug mode
40 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
41 | *
42 | * // where to put the JS bundle asset in release mode
43 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
44 | *
45 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
46 | * // require('./image.png')), in debug mode
47 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
48 | *
49 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
50 | * // require('./image.png')), in release mode
51 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
52 | *
53 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
54 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
55 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle
56 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
57 | * // for example, you might want to remove it from here.
58 | * inputExcludes: ["android/**", "ios/**"],
59 | *
60 | * // override which node gets called and with what additional arguments
61 | * nodeExecutableAndArgs: ["node"]
62 | *
63 | * // supply additional arguments to the packager
64 | * extraPackagerArgs: []
65 | * ]
66 | */
67 |
68 | apply from: "../../node_modules/react-native/react.gradle"
69 |
70 | /**
71 | * Set this to true to create two separate APKs instead of one:
72 | * - An APK that only works on ARM devices
73 | * - An APK that only works on x86 devices
74 | * The advantage is the size of the APK is reduced by about 4MB.
75 | * Upload all the APKs to the Play Store and people will download
76 | * the correct one based on the CPU architecture of their device.
77 | */
78 | def enableSeparateBuildPerCPUArchitecture = false
79 |
80 | /**
81 | * Run Proguard to shrink the Java bytecode in release builds.
82 | */
83 | def enableProguardInReleaseBuilds = false
84 |
85 | android {
86 | compileSdkVersion 23
87 | buildToolsVersion "23.0.1"
88 |
89 | defaultConfig {
90 | applicationId "com.resizerexample"
91 | minSdkVersion 16
92 | targetSdkVersion 22
93 | versionCode 1
94 | versionName "1.0"
95 | ndk {
96 | abiFilters "armeabi-v7a", "x86"
97 | }
98 | }
99 | splits {
100 | abi {
101 | reset()
102 | enable enableSeparateBuildPerCPUArchitecture
103 | universalApk false // If true, also generate a universal APK
104 | include "armeabi-v7a", "x86"
105 | }
106 | }
107 | buildTypes {
108 | release {
109 | minifyEnabled enableProguardInReleaseBuilds
110 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
111 | }
112 | }
113 | // applicationVariants are e.g. debug, release
114 | applicationVariants.all { variant ->
115 | variant.outputs.each { output ->
116 | // For each separate APK per architecture, set a unique version code as described here:
117 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
118 | def versionCodes = ["armeabi-v7a":1, "x86":2]
119 | def abi = output.getFilter(OutputFile.ABI)
120 | if (abi != null) { // null for the universal-debug, universal-release variants
121 | output.versionCodeOverride =
122 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
123 | }
124 | }
125 | }
126 | }
127 |
128 | dependencies {
129 | compile project(':react-native-image-resizer')
130 | compile fileTree(dir: "libs", include: ["*.jar"])
131 | compile "com.android.support:appcompat-v7:23.0.1"
132 | compile "com.facebook.react:react-native:+" // From node_modules
133 | }
134 |
135 | // Run this once to be able to run the application with BUCK
136 | // puts all compile dependencies into folder libs for BUCK to use
137 | task copyDownloadableDepsToLibs(type: Copy) {
138 | from configurations.compile
139 | into 'libs'
140 | }
141 |
--------------------------------------------------------------------------------
/ios/RCTImageResizer/RCTImageResizer.m:
--------------------------------------------------------------------------------
1 | //
2 | // ImageResize.m
3 | // ChoozItApp
4 | //
5 | // Created by Florian Rival on 19/11/15.
6 | //
7 |
8 | #include "RCTImageResizer.h"
9 | #include "ImageHelpers.h"
10 | #import
11 |
12 | @implementation ImageResizer
13 |
14 | @synthesize bridge = _bridge;
15 |
16 | RCT_EXPORT_MODULE();
17 |
18 | bool saveImage(NSString * fullPath, UIImage * image, NSString * format, float quality)
19 | {
20 | NSData* data = nil;
21 | if ([format isEqualToString:@"JPEG"]) {
22 | data = UIImageJPEGRepresentation(image, quality / 100.0);
23 | } else if ([format isEqualToString:@"PNG"]) {
24 | data = UIImagePNGRepresentation(image);
25 | }
26 |
27 | if (data == nil) {
28 | return NO;
29 | }
30 |
31 | NSFileManager* fileManager = [NSFileManager defaultManager];
32 | return [fileManager createFileAtPath:fullPath contents:data attributes:nil];
33 | }
34 |
35 | NSString * generateFilePath(NSString * ext, NSString * outputPath)
36 | {
37 | NSString* directory;
38 |
39 | if ([outputPath length] == 0) {
40 | NSArray* paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
41 | directory = [paths firstObject];
42 | } else {
43 | NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
44 | NSString *documentsDirectory = [paths objectAtIndex:0];
45 | directory = [documentsDirectory stringByAppendingPathComponent:outputPath];
46 | NSError *error;
47 | [[NSFileManager defaultManager] createDirectoryAtPath:directory withIntermediateDirectories:YES attributes:nil error:&error];
48 | if (error) {
49 | NSLog(@"Error creating documents subdirectory: %@", error);
50 | @throw [NSException exceptionWithName:@"InvalidPathException" reason:[NSString stringWithFormat:@"Error creating documents subdirectory: %@", error] userInfo:nil];
51 | }
52 | }
53 |
54 | NSString* name = [[NSUUID UUID] UUIDString];
55 | NSString* fullName = [NSString stringWithFormat:@"%@.%@", name, ext];
56 | NSString* fullPath = [directory stringByAppendingPathComponent:fullName];
57 |
58 | return fullPath;
59 | }
60 |
61 | UIImage * rotateImage(UIImage *inputImage, float rotationDegrees)
62 | {
63 |
64 | // We want only fixed 0, 90, 180, 270 degree rotations.
65 | const int rotDiv90 = (int)round(rotationDegrees / 90);
66 | const int rotQuadrant = rotDiv90 % 4;
67 | const int rotQuadrantAbs = (rotQuadrant < 0) ? rotQuadrant + 4 : rotQuadrant;
68 |
69 | // Return the input image if no rotation specified.
70 | if (0 == rotQuadrantAbs) {
71 | return inputImage;
72 | } else {
73 | // Rotate the image by 80, 180, 270.
74 | UIImageOrientation orientation = UIImageOrientationUp;
75 |
76 | switch(rotQuadrantAbs) {
77 | case 1:
78 | orientation = UIImageOrientationRight; // 90 deg CW
79 | break;
80 | case 2:
81 | orientation = UIImageOrientationDown; // 180 deg rotation
82 | break;
83 | default:
84 | orientation = UIImageOrientationLeft; // 90 deg CCW
85 | break;
86 | }
87 |
88 | return [[UIImage alloc] initWithCGImage: inputImage.CGImage
89 | scale: 1.0
90 | orientation: orientation];
91 | }
92 | }
93 |
94 | RCT_EXPORT_METHOD(createResizedImage:(NSString *)path
95 | width:(float)width
96 | height:(float)height
97 | format:(NSString *)format
98 | quality:(float)quality
99 | rotation:(float)rotation
100 | outputPath:(NSString *)outputPath
101 | callback:(RCTResponseSenderBlock)callback)
102 | {
103 | CGSize newSize = CGSizeMake(width, height);
104 |
105 | //Set image extension
106 | NSString *extension = @"jpg";
107 | if ([format isEqualToString:@"PNG"]) {
108 | extension = @"png";
109 | }
110 |
111 |
112 | NSString* fullPath;
113 | @try {
114 | fullPath = generateFilePath(extension, outputPath);
115 | } @catch (NSException *exception) {
116 | callback(@[@"Invalid output path.", @""]);
117 | return;
118 | }
119 |
120 | [_bridge.imageLoader loadImageWithURLRequest:[RCTConvert NSURLRequest:path] callback:^(NSError *error, UIImage *image) {
121 | if (error || image == nil) {
122 | if ([path hasPrefix:@"data:"] || [path hasPrefix:@"file:"]) {
123 | NSURL *imageUrl = [[NSURL alloc] initWithString:path];
124 | image = [UIImage imageWithData:[NSData dataWithContentsOfURL:imageUrl]];
125 | } else {
126 | image = [[UIImage alloc] initWithContentsOfFile:path];
127 | }
128 | if (image == nil) {
129 | callback(@[@"Can't retrieve the file from the path.", @""]);
130 | return;
131 | }
132 | }
133 |
134 | // Rotate image if rotation is specified.
135 | if (0 != (int)rotation) {
136 | image = rotateImage(image, rotation);
137 | if (image == nil) {
138 | callback(@[@"Can't rotate the image.", @""]);
139 | return;
140 | }
141 | }
142 |
143 | // Do the resizing
144 | UIImage * scaledImage = [image scaleToSize:newSize];
145 | if (scaledImage == nil) {
146 | callback(@[@"Can't resize the image.", @""]);
147 | return;
148 | }
149 |
150 | // Compress and save the image
151 | if (!saveImage(fullPath, scaledImage, format, quality)) {
152 | callback(@[@"Can't save the image. Check your compression format and your output path", @""]);
153 | return;
154 | }
155 | NSURL *fileUrl = [[NSURL alloc] initFileURLWithPath:fullPath];
156 | NSString *fileName = fileUrl.lastPathComponent;
157 | NSError *attributesError = nil;
158 | NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:fullPath error:&attributesError];
159 | NSNumber *fileSize = fileAttributes == nil ? 0 : [fileAttributes objectForKey:NSFileSize];
160 | NSDictionary *response = @{@"path": fullPath,
161 | @"uri": fileUrl.absoluteString,
162 | @"name": fileName,
163 | @"size": fileSize == nil ? @(0) : fileSize
164 | };
165 |
166 | callback(@[[NSNull null], response]);
167 | }];
168 | }
169 |
170 | @end
171 |
--------------------------------------------------------------------------------
/ios/RCTImageResizer/ImageHelpers.m:
--------------------------------------------------------------------------------
1 | /*
2 | File: ImageHelpers.m
3 |
4 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
5 | Inc. ("Apple") in consideration of your agreement to the following
6 | terms, and your use, installation, modification or redistribution of
7 | this Apple software constitutes acceptance of these terms. If you do
8 | not agree with these terms, please do not use, install, modify or
9 | redistribute this Apple software.
10 |
11 | In consideration of your agreement to abide by the following terms, and
12 | subject to these terms, Apple grants you a personal, non-exclusive
13 | license, under Apple's copyrights in this original Apple software (the
14 | "Apple Software"), to use, reproduce, modify and redistribute the Apple
15 | Software, with or without modifications, in source and/or binary forms;
16 | provided that if you redistribute the Apple Software in its entirety and
17 | without modifications, you must retain this notice and the following
18 | text and disclaimers in all such redistributions of the Apple Software.
19 | Neither the name, trademarks, service marks or logos of Apple Inc. may
20 | be used to endorse or promote products derived from the Apple Software
21 | without specific prior written permission from Apple. Except as
22 | expressly stated in this notice, no other rights or licenses, express or
23 | implied, are granted by Apple herein, including but not limited to any
24 | patent rights that may be infringed by your derivative works or by other
25 | works in which the Apple Software may be incorporated.
26 |
27 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE
28 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
29 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
30 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
31 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
32 |
33 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
34 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
35 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
36 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
37 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
38 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
39 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
40 | POSSIBILITY OF SUCH DAMAGE.
41 |
42 | Copyright (C) 2009 Apple Inc. All Rights Reserved.
43 | */
44 |
45 | #include "ImageHelpers.h"
46 |
47 | const CGBitmapInfo kDefaultCGBitmapInfo = (kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host);
48 | const CGBitmapInfo kDefaultCGBitmapInfoNoAlpha = (kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Host);
49 |
50 | CGColorSpaceRef GetDeviceRGBColorSpace() {
51 | static CGColorSpaceRef deviceRGBSpace = NULL;
52 | if( deviceRGBSpace == NULL )
53 | deviceRGBSpace = CGColorSpaceCreateDeviceRGB();
54 | return deviceRGBSpace;
55 | }
56 |
57 | float GetScaleForProportionalResize( CGSize theSize, CGSize intoSize, bool onlyScaleDown, bool maximize )
58 | {
59 | float sx = theSize.width;
60 | float sy = theSize.height;
61 | float dx = intoSize.width;
62 | float dy = intoSize.height;
63 | float scale = 1;
64 |
65 | if( sx != 0 && sy != 0 )
66 | {
67 | dx = dx / sx;
68 | dy = dy / sy;
69 |
70 | // if maximize is true, take LARGER of the scales, else smaller
71 | if( maximize ) scale = (dx > dy) ? dx : dy;
72 | else scale = (dx < dy) ? dx : dy;
73 |
74 | if( scale > 1 && onlyScaleDown ) // reset scale
75 | scale = 1;
76 | }
77 | else
78 | {
79 | scale = 0;
80 | }
81 | return scale;
82 | }
83 |
84 | CGContextRef CreateCGBitmapContextForWidthAndHeight( unsigned int width, unsigned int height,
85 | CGColorSpaceRef optionalColorSpace, CGBitmapInfo optionalInfo )
86 | {
87 | CGColorSpaceRef colorSpace = (optionalColorSpace == NULL) ? GetDeviceRGBColorSpace() : optionalColorSpace;
88 | CGBitmapInfo alphaInfo = ( (int32_t)optionalInfo < 0 ) ? kDefaultCGBitmapInfo : optionalInfo;
89 | return CGBitmapContextCreate( NULL, width, height, 8, 0, colorSpace, alphaInfo );
90 | }
91 |
92 | CGImageRef CreateCGImageFromUIImageScaled( UIImage* image, float scaleFactor )
93 | {
94 | CGImageRef newImage = NULL;
95 | CGContextRef bmContext = NULL;
96 | BOOL mustTransform = YES;
97 | CGAffineTransform transform = CGAffineTransformIdentity;
98 | UIImageOrientation orientation = image.imageOrientation;
99 |
100 | CGImageRef srcCGImage = CGImageRetain( image.CGImage );
101 |
102 | size_t width = CGImageGetWidth(srcCGImage) * scaleFactor;
103 | size_t height = CGImageGetHeight(srcCGImage) * scaleFactor;
104 |
105 | // These Orientations are rotated 0 or 180 degrees, so they retain the width/height of the image
106 | if( (orientation == UIImageOrientationUp) || (orientation == UIImageOrientationDown) || (orientation == UIImageOrientationUpMirrored) || (orientation == UIImageOrientationDownMirrored) )
107 | {
108 | bmContext = CreateCGBitmapContextForWidthAndHeight( width, height, NULL, kDefaultCGBitmapInfo );
109 | }
110 | else // The other Orientations are rotated ±90 degrees, so they swap width & height.
111 | {
112 | bmContext = CreateCGBitmapContextForWidthAndHeight( height, width, NULL, kDefaultCGBitmapInfo );
113 | }
114 |
115 | //CGContextSetInterpolationQuality( bmContext, kCGInterpolationLow );
116 | CGContextSetBlendMode( bmContext, kCGBlendModeCopy ); // we just want to copy the data
117 |
118 | switch(orientation)
119 | {
120 | case UIImageOrientationDown: // 0th row is at the bottom, and 0th column is on the right - Rotate 180 degrees
121 | transform = CGAffineTransformMake(-1.0, 0.0, 0.0, -1.0, width, height);
122 | break;
123 |
124 | case UIImageOrientationLeft: // 0th row is on the left, and 0th column is the bottom - Rotate -90 degrees
125 | transform = CGAffineTransformMake(0.0, 1.0, -1.0, 0.0, height, 0.0);
126 | break;
127 |
128 | case UIImageOrientationRight: // 0th row is on the right, and 0th column is the top - Rotate 90 degrees
129 | transform = CGAffineTransformMake(0.0, -1.0, 1.0, 0.0, 0.0, width);
130 | break;
131 |
132 | case UIImageOrientationUpMirrored: // 0th row is at the top, and 0th column is on the right - Flip Horizontal
133 | transform = CGAffineTransformMake(-1.0, 0.0, 0.0, 1.0, width, 0.0);
134 | break;
135 |
136 | case UIImageOrientationDownMirrored: // 0th row is at the bottom, and 0th column is on the left - Flip Vertical
137 | transform = CGAffineTransformMake(1.0, 0.0, 0, -1.0, 0.0, height);
138 | break;
139 |
140 | case UIImageOrientationLeftMirrored: // 0th row is on the left, and 0th column is the top - Rotate -90 degrees and Flip Vertical
141 | transform = CGAffineTransformMake(0.0, -1.0, -1.0, 0.0, height, width);
142 | break;
143 |
144 | case UIImageOrientationRightMirrored: // 0th row is on the right, and 0th column is the bottom - Rotate 90 degrees and Flip Vertical
145 | transform = CGAffineTransformMake(0.0, 1.0, 1.0, 0.0, 0.0, 0.0);
146 | break;
147 |
148 | default:
149 | mustTransform = NO;
150 | break;
151 | }
152 |
153 | if( mustTransform ) CGContextConcatCTM( bmContext, transform );
154 |
155 | CGContextDrawImage( bmContext, CGRectMake(0.0, 0.0, width, height), srcCGImage );
156 | CGImageRelease( srcCGImage );
157 | newImage = CGBitmapContextCreateImage( bmContext );
158 | CFRelease( bmContext );
159 |
160 | return newImage;
161 | }
162 |
163 | @implementation UIImage (scale)
164 |
165 | -(UIImage*) scaleToSize:(CGSize)toSize
166 | {
167 | UIImage *scaledImg = nil;
168 | float scale = GetScaleForProportionalResize( self.size, toSize, false, false );
169 | CGImageRef cgImage = CreateCGImageFromUIImageScaled( self, scale );
170 |
171 | if( cgImage )
172 | {
173 | scaledImg = [UIImage imageWithCGImage:cgImage]; // autoreleased
174 | CGImageRelease( cgImage );
175 | }
176 | return scaledImg;
177 | }
178 |
179 | @end
180 |
--------------------------------------------------------------------------------
/ios/RCTImageResizer.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 5D72D2EC1C16249000E22EC1 /* RCTImageResizer.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5D72D2EB1C16249000E22EC1 /* RCTImageResizer.h */; };
11 | 5D72D2EE1C16249000E22EC1 /* RCTImageResizer.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D72D2ED1C16249000E22EC1 /* RCTImageResizer.m */; };
12 | B62D1C4C1C95C21300AD70F2 /* ImageHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = B62D1C4B1C95C21300AD70F2 /* ImageHelpers.m */; };
13 | /* End PBXBuildFile section */
14 |
15 | /* Begin PBXCopyFilesBuildPhase section */
16 | 5D72D2E61C16249000E22EC1 /* CopyFiles */ = {
17 | isa = PBXCopyFilesBuildPhase;
18 | buildActionMask = 2147483647;
19 | dstPath = "include/$(PRODUCT_NAME)";
20 | dstSubfolderSpec = 16;
21 | files = (
22 | 5D72D2EC1C16249000E22EC1 /* RCTImageResizer.h in CopyFiles */,
23 | );
24 | runOnlyForDeploymentPostprocessing = 0;
25 | };
26 | /* End PBXCopyFilesBuildPhase section */
27 |
28 | /* Begin PBXFileReference section */
29 | 5D72D2E81C16249000E22EC1 /* libRCTImageResizer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTImageResizer.a; sourceTree = BUILT_PRODUCTS_DIR; };
30 | 5D72D2EB1C16249000E22EC1 /* RCTImageResizer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTImageResizer.h; sourceTree = ""; };
31 | 5D72D2ED1C16249000E22EC1 /* RCTImageResizer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RCTImageResizer.m; sourceTree = ""; };
32 | B62D1C4A1C95C21300AD70F2 /* ImageHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageHelpers.h; sourceTree = ""; };
33 | B62D1C4B1C95C21300AD70F2 /* ImageHelpers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageHelpers.m; sourceTree = ""; };
34 | /* End PBXFileReference section */
35 |
36 | /* Begin PBXFrameworksBuildPhase section */
37 | 5D72D2E51C16249000E22EC1 /* Frameworks */ = {
38 | isa = PBXFrameworksBuildPhase;
39 | buildActionMask = 2147483647;
40 | files = (
41 | );
42 | runOnlyForDeploymentPostprocessing = 0;
43 | };
44 | /* End PBXFrameworksBuildPhase section */
45 |
46 | /* Begin PBXGroup section */
47 | 5D72D2DF1C16249000E22EC1 = {
48 | isa = PBXGroup;
49 | children = (
50 | 5D72D2EA1C16249000E22EC1 /* RCTImageResizer */,
51 | 5D72D2E91C16249000E22EC1 /* Products */,
52 | );
53 | sourceTree = "";
54 | };
55 | 5D72D2E91C16249000E22EC1 /* Products */ = {
56 | isa = PBXGroup;
57 | children = (
58 | 5D72D2E81C16249000E22EC1 /* libRCTImageResizer.a */,
59 | );
60 | name = Products;
61 | sourceTree = "";
62 | };
63 | 5D72D2EA1C16249000E22EC1 /* RCTImageResizer */ = {
64 | isa = PBXGroup;
65 | children = (
66 | 5D72D2EB1C16249000E22EC1 /* RCTImageResizer.h */,
67 | 5D72D2ED1C16249000E22EC1 /* RCTImageResizer.m */,
68 | B62D1C4A1C95C21300AD70F2 /* ImageHelpers.h */,
69 | B62D1C4B1C95C21300AD70F2 /* ImageHelpers.m */,
70 | );
71 | path = RCTImageResizer;
72 | sourceTree = "";
73 | };
74 | /* End PBXGroup section */
75 |
76 | /* Begin PBXNativeTarget section */
77 | 5D72D2E71C16249000E22EC1 /* RCTImageResizer */ = {
78 | isa = PBXNativeTarget;
79 | buildConfigurationList = 5D72D2F11C16249000E22EC1 /* Build configuration list for PBXNativeTarget "RCTImageResizer" */;
80 | buildPhases = (
81 | 5D72D2E41C16249000E22EC1 /* Sources */,
82 | 5D72D2E51C16249000E22EC1 /* Frameworks */,
83 | 5D72D2E61C16249000E22EC1 /* CopyFiles */,
84 | );
85 | buildRules = (
86 | );
87 | dependencies = (
88 | );
89 | name = RCTImageResizer;
90 | productName = RCTImageResizer;
91 | productReference = 5D72D2E81C16249000E22EC1 /* libRCTImageResizer.a */;
92 | productType = "com.apple.product-type.library.static";
93 | };
94 | /* End PBXNativeTarget section */
95 |
96 | /* Begin PBXProject section */
97 | 5D72D2E01C16249000E22EC1 /* Project object */ = {
98 | isa = PBXProject;
99 | attributes = {
100 | LastUpgradeCheck = 0710;
101 | ORGANIZATIONNAME = "Atticus White";
102 | TargetAttributes = {
103 | 5D72D2E71C16249000E22EC1 = {
104 | CreatedOnToolsVersion = 7.1.1;
105 | };
106 | };
107 | };
108 | buildConfigurationList = 5D72D2E31C16249000E22EC1 /* Build configuration list for PBXProject "RCTImageResizer" */;
109 | compatibilityVersion = "Xcode 3.2";
110 | developmentRegion = English;
111 | hasScannedForEncodings = 0;
112 | knownRegions = (
113 | en,
114 | );
115 | mainGroup = 5D72D2DF1C16249000E22EC1;
116 | productRefGroup = 5D72D2E91C16249000E22EC1 /* Products */;
117 | projectDirPath = "";
118 | projectRoot = "";
119 | targets = (
120 | 5D72D2E71C16249000E22EC1 /* RCTImageResizer */,
121 | );
122 | };
123 | /* End PBXProject section */
124 |
125 | /* Begin PBXSourcesBuildPhase section */
126 | 5D72D2E41C16249000E22EC1 /* Sources */ = {
127 | isa = PBXSourcesBuildPhase;
128 | buildActionMask = 2147483647;
129 | files = (
130 | 5D72D2EE1C16249000E22EC1 /* RCTImageResizer.m in Sources */,
131 | B62D1C4C1C95C21300AD70F2 /* ImageHelpers.m in Sources */,
132 | );
133 | runOnlyForDeploymentPostprocessing = 0;
134 | };
135 | /* End PBXSourcesBuildPhase section */
136 |
137 | /* Begin XCBuildConfiguration section */
138 | 5D72D2EF1C16249000E22EC1 /* Debug */ = {
139 | isa = XCBuildConfiguration;
140 | buildSettings = {
141 | ALWAYS_SEARCH_USER_PATHS = NO;
142 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
143 | CLANG_CXX_LIBRARY = "libc++";
144 | CLANG_ENABLE_MODULES = YES;
145 | CLANG_ENABLE_OBJC_ARC = YES;
146 | CLANG_WARN_BOOL_CONVERSION = YES;
147 | CLANG_WARN_CONSTANT_CONVERSION = YES;
148 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
149 | CLANG_WARN_EMPTY_BODY = YES;
150 | CLANG_WARN_ENUM_CONVERSION = YES;
151 | CLANG_WARN_INT_CONVERSION = YES;
152 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
153 | CLANG_WARN_UNREACHABLE_CODE = YES;
154 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
155 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
156 | COPY_PHASE_STRIP = NO;
157 | DEBUG_INFORMATION_FORMAT = dwarf;
158 | ENABLE_STRICT_OBJC_MSGSEND = YES;
159 | ENABLE_TESTABILITY = YES;
160 | GCC_C_LANGUAGE_STANDARD = gnu99;
161 | GCC_DYNAMIC_NO_PIC = NO;
162 | GCC_NO_COMMON_BLOCKS = YES;
163 | GCC_OPTIMIZATION_LEVEL = 0;
164 | GCC_PREPROCESSOR_DEFINITIONS = (
165 | "DEBUG=1",
166 | "$(inherited)",
167 | );
168 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
169 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
170 | GCC_WARN_UNDECLARED_SELECTOR = YES;
171 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
172 | GCC_WARN_UNUSED_FUNCTION = YES;
173 | GCC_WARN_UNUSED_VARIABLE = YES;
174 | IPHONEOS_DEPLOYMENT_TARGET = 9.1;
175 | MTL_ENABLE_DEBUG_INFO = YES;
176 | ONLY_ACTIVE_ARCH = YES;
177 | SDKROOT = iphoneos;
178 | };
179 | name = Debug;
180 | };
181 | 5D72D2F01C16249000E22EC1 /* Release */ = {
182 | isa = XCBuildConfiguration;
183 | buildSettings = {
184 | ALWAYS_SEARCH_USER_PATHS = NO;
185 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
186 | CLANG_CXX_LIBRARY = "libc++";
187 | CLANG_ENABLE_MODULES = YES;
188 | CLANG_ENABLE_OBJC_ARC = YES;
189 | CLANG_WARN_BOOL_CONVERSION = YES;
190 | CLANG_WARN_CONSTANT_CONVERSION = YES;
191 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
192 | CLANG_WARN_EMPTY_BODY = YES;
193 | CLANG_WARN_ENUM_CONVERSION = YES;
194 | CLANG_WARN_INT_CONVERSION = YES;
195 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
196 | CLANG_WARN_UNREACHABLE_CODE = YES;
197 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
198 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
199 | COPY_PHASE_STRIP = NO;
200 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
201 | ENABLE_NS_ASSERTIONS = NO;
202 | ENABLE_STRICT_OBJC_MSGSEND = YES;
203 | GCC_C_LANGUAGE_STANDARD = gnu99;
204 | GCC_NO_COMMON_BLOCKS = YES;
205 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
206 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
207 | GCC_WARN_UNDECLARED_SELECTOR = YES;
208 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
209 | GCC_WARN_UNUSED_FUNCTION = YES;
210 | GCC_WARN_UNUSED_VARIABLE = YES;
211 | IPHONEOS_DEPLOYMENT_TARGET = 9.1;
212 | MTL_ENABLE_DEBUG_INFO = NO;
213 | SDKROOT = iphoneos;
214 | VALIDATE_PRODUCT = YES;
215 | };
216 | name = Release;
217 | };
218 | 5D72D2F21C16249000E22EC1 /* Debug */ = {
219 | isa = XCBuildConfiguration;
220 | buildSettings = {
221 | HEADER_SEARCH_PATHS = (
222 | "$(inherited)",
223 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
224 | "$(SRCROOT)/../../react-native/React/**",
225 | "$(SRCROOT)/../../react-native/Libraries/**",
226 | );
227 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
228 | OTHER_LDFLAGS = "-ObjC";
229 | PRODUCT_NAME = "$(TARGET_NAME)";
230 | SKIP_INSTALL = YES;
231 | };
232 | name = Debug;
233 | };
234 | 5D72D2F31C16249000E22EC1 /* Release */ = {
235 | isa = XCBuildConfiguration;
236 | buildSettings = {
237 | HEADER_SEARCH_PATHS = (
238 | "$(inherited)",
239 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
240 | "$(SRCROOT)/../../react-native/React/**",
241 | "$(SRCROOT)/../../react-native/Libraries/**",
242 | );
243 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
244 | OTHER_LDFLAGS = "-ObjC";
245 | PRODUCT_NAME = "$(TARGET_NAME)";
246 | SKIP_INSTALL = YES;
247 | };
248 | name = Release;
249 | };
250 | /* End XCBuildConfiguration section */
251 |
252 | /* Begin XCConfigurationList section */
253 | 5D72D2E31C16249000E22EC1 /* Build configuration list for PBXProject "RCTImageResizer" */ = {
254 | isa = XCConfigurationList;
255 | buildConfigurations = (
256 | 5D72D2EF1C16249000E22EC1 /* Debug */,
257 | 5D72D2F01C16249000E22EC1 /* Release */,
258 | );
259 | defaultConfigurationIsVisible = 0;
260 | defaultConfigurationName = Release;
261 | };
262 | 5D72D2F11C16249000E22EC1 /* Build configuration list for PBXNativeTarget "RCTImageResizer" */ = {
263 | isa = XCConfigurationList;
264 | buildConfigurations = (
265 | 5D72D2F21C16249000E22EC1 /* Debug */,
266 | 5D72D2F31C16249000E22EC1 /* Release */,
267 | );
268 | defaultConfigurationIsVisible = 0;
269 | defaultConfigurationName = Release;
270 | };
271 | /* End XCConfigurationList section */
272 | };
273 | rootObject = 5D72D2E01C16249000E22EC1 /* Project object */;
274 | }
275 |
--------------------------------------------------------------------------------
/android/src/main/java/fr/bamlab/rnimageresizer/ImageResizer.java:
--------------------------------------------------------------------------------
1 | package fr.bamlab.rnimageresizer;
2 |
3 | import android.content.Context;
4 | import android.content.ContentResolver;
5 | import android.database.Cursor;
6 | import android.graphics.Bitmap;
7 | import android.graphics.BitmapFactory;
8 | import android.graphics.Matrix;
9 | import android.media.ExifInterface;
10 | import android.net.Uri;
11 | import android.provider.MediaStore;
12 | import android.util.Base64;
13 |
14 | import java.io.ByteArrayOutputStream;
15 | import java.io.File;
16 | import java.io.FileOutputStream;
17 | import java.io.InputStream;
18 | import java.io.IOException;
19 | import java.util.Date;
20 |
21 | /**
22 | * Provide methods to resize and rotate an image file.
23 | */
24 | public class ImageResizer {
25 | private final static String IMAGE_JPEG = "image/jpeg";
26 | private final static String IMAGE_PNG = "image/png";
27 | private final static String SCHEME_DATA = "data";
28 | private final static String SCHEME_CONTENT = "content";
29 | private final static String SCHEME_FILE = "file";
30 |
31 | /**
32 | * Resize the specified bitmap, keeping its aspect ratio.
33 | */
34 | private static Bitmap resizeImage(Bitmap image, int maxWidth, int maxHeight) {
35 | Bitmap newImage = null;
36 | if (image == null) {
37 | return null; // Can't load the image from the given path.
38 | }
39 |
40 | if (maxHeight > 0 && maxWidth > 0) {
41 | float width = image.getWidth();
42 | float height = image.getHeight();
43 |
44 | float ratio = Math.min((float)maxWidth / width, (float)maxHeight / height);
45 |
46 | int finalWidth = (int) (width * ratio);
47 | int finalHeight = (int) (height * ratio);
48 | try {
49 | newImage = Bitmap.createScaledBitmap(image, finalWidth, finalHeight, true);
50 | } catch (OutOfMemoryError e) {
51 | return null;
52 | }
53 | }
54 |
55 | return newImage;
56 | }
57 |
58 | /**
59 | * Rotate the specified bitmap with the given angle, in degrees.
60 | */
61 | public static Bitmap rotateImage(Bitmap source, float angle)
62 | {
63 | Bitmap retVal;
64 |
65 | Matrix matrix = new Matrix();
66 | matrix.postRotate(angle);
67 | try {
68 | retVal = Bitmap.createBitmap(source, 0, 0, source.getWidth(), source.getHeight(), matrix, true);
69 | } catch (OutOfMemoryError e) {
70 | return null;
71 | }
72 | return retVal;
73 | }
74 |
75 | /**
76 | * Save the given bitmap in a directory. Extension is automatically generated using the bitmap format.
77 | */
78 | private static File saveImage(Bitmap bitmap, File saveDirectory, String fileName,
79 | Bitmap.CompressFormat compressFormat, int quality)
80 | throws IOException {
81 | if (bitmap == null) {
82 | throw new IOException("The bitmap couldn't be resized");
83 | }
84 |
85 | File newFile = new File(saveDirectory, fileName + "." + compressFormat.name());
86 | if(!newFile.createNewFile()) {
87 | throw new IOException("The file already exists");
88 | }
89 |
90 | ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
91 | bitmap.compress(compressFormat, quality, outputStream);
92 | byte[] bitmapData = outputStream.toByteArray();
93 |
94 | outputStream.flush();
95 | outputStream.close();
96 |
97 | FileOutputStream fos = new FileOutputStream(newFile);
98 | fos.write(bitmapData);
99 | fos.flush();
100 | fos.close();
101 |
102 | return newFile;
103 | }
104 |
105 | /**
106 | * Get {@link File} object for the given Android URI.
107 | * Use content resolver to get real path if direct path doesn't return valid file.
108 | */
109 | private static File getFileFromUri(Context context, Uri uri) {
110 |
111 | // first try by direct path
112 | File file = new File(uri.getPath());
113 | if (file.exists()) {
114 | return file;
115 | }
116 |
117 | // try reading real path from content resolver (gallery images)
118 | Cursor cursor = null;
119 | try {
120 | String[] proj = {MediaStore.Images.Media.DATA};
121 | cursor = context.getContentResolver().query(uri, proj, null, null, null);
122 | int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
123 | cursor.moveToFirst();
124 | String realPath = cursor.getString(column_index);
125 | file = new File(realPath);
126 | } catch (Exception ignored) {
127 | } finally {
128 | if (cursor != null) {
129 | cursor.close();
130 | }
131 | }
132 |
133 | return file;
134 | }
135 |
136 |
137 | /**
138 | * Get orientation by reading Image metadata
139 | */
140 | public static int getOrientation(Context context, Uri uri) {
141 | try {
142 | File file = getFileFromUri(context, uri);
143 | if (file.exists()) {
144 | ExifInterface ei = new ExifInterface(file.getAbsolutePath());
145 | return getOrientation(ei);
146 | }
147 | } catch (Exception ignored) { }
148 |
149 | return 0;
150 | }
151 |
152 | /**
153 | * Convert metadata to degrees
154 | */
155 | public static int getOrientation(ExifInterface exif) {
156 | int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
157 | switch (orientation) {
158 | case ExifInterface.ORIENTATION_ROTATE_90:
159 | return 90;
160 | case ExifInterface.ORIENTATION_ROTATE_180:
161 | return 180;
162 | case ExifInterface.ORIENTATION_ROTATE_270:
163 | return 270;
164 | default:
165 | return 0;
166 | }
167 | }
168 |
169 | /**
170 | * Compute the inSampleSize value to use to load a bitmap.
171 | * Adapted from https://developer.android.com/training/displaying-bitmaps/load-bitmap.html
172 | */
173 | private static int calculateInSampleSize(BitmapFactory.Options options, int reqWidth, int reqHeight) {
174 | final int height = options.outHeight;
175 | final int width = options.outWidth;
176 |
177 | int inSampleSize = 1;
178 |
179 | if (height > reqHeight || width > reqWidth) {
180 | final int halfHeight = height / 2;
181 | final int halfWidth = width / 2;
182 |
183 | // Calculate the largest inSampleSize value that is a power of 2 and keeps both
184 | // height and width larger than the requested height and width.
185 | while ((halfHeight / inSampleSize) >= reqHeight && (halfWidth / inSampleSize) >= reqWidth) {
186 | inSampleSize *= 2;
187 | }
188 | }
189 |
190 | return inSampleSize;
191 | }
192 |
193 | /**
194 | * Load a bitmap either from a real file or using the {@link ContentResolver} of the current
195 | * {@link Context} (to read gallery images for example).
196 | *
197 | * Note that, when options.inJustDecodeBounds = true, we actually expect sourceImage to remain
198 | * as null (see https://developer.android.com/training/displaying-bitmaps/load-bitmap.html), so
199 | * getting null sourceImage at the completion of this method is not always worthy of an error.
200 | */
201 | private static Bitmap loadBitmap(Context context, Uri imageUri, BitmapFactory.Options options) throws IOException {
202 | Bitmap sourceImage = null;
203 | String imageUriScheme = imageUri.getScheme();
204 | if (imageUriScheme == null || !imageUriScheme.equalsIgnoreCase(SCHEME_CONTENT)) {
205 | try {
206 | sourceImage = BitmapFactory.decodeFile(imageUri.getPath(), options);
207 | } catch (Exception e) {
208 | e.printStackTrace();
209 | throw new IOException("Error decoding image file");
210 | }
211 | } else {
212 | ContentResolver cr = context.getContentResolver();
213 | InputStream input = cr.openInputStream(imageUri);
214 | if (input != null) {
215 | sourceImage = BitmapFactory.decodeStream(input, null, options);
216 | input.close();
217 | }
218 | }
219 | return sourceImage;
220 | }
221 |
222 | /**
223 | * Loads the bitmap resource from the file specified in imagePath.
224 | */
225 | private static Bitmap loadBitmapFromFile(Context context, Uri imageUri, int newWidth,
226 | int newHeight) throws IOException {
227 | // Decode the image bounds to find the size of the source image.
228 | BitmapFactory.Options options = new BitmapFactory.Options();
229 | options.inJustDecodeBounds = true;
230 | loadBitmap(context, imageUri, options);
231 |
232 | // Set a sample size according to the image size to lower memory usage.
233 | options.inSampleSize = calculateInSampleSize(options, newWidth, newHeight);
234 | options.inJustDecodeBounds = false;
235 | System.out.println(options.inSampleSize);
236 | return loadBitmap(context, imageUri, options);
237 |
238 | }
239 |
240 | /**
241 | * Loads the bitmap resource from a base64 encoded jpg or png.
242 | * Format is as such:
243 | * png: 'data:image/png;base64,iVBORw0KGgoAA...'
244 | * jpg: 'data:image/jpeg;base64,/9j/4AAQSkZJ...'
245 | */
246 | private static Bitmap loadBitmapFromBase64(Uri imageUri) {
247 | Bitmap sourceImage = null;
248 | String imagePath = imageUri.getSchemeSpecificPart();
249 | int commaLocation = imagePath.indexOf(',');
250 | if (commaLocation != -1) {
251 | final String mimeType = imagePath.substring(0, commaLocation).replace('\\','/').toLowerCase();
252 | final boolean isJpeg = mimeType.startsWith(IMAGE_JPEG);
253 | final boolean isPng = !isJpeg && mimeType.startsWith(IMAGE_PNG);
254 |
255 | if (isJpeg || isPng) {
256 | // base64 image. Convert to a bitmap.
257 | final String encodedImage = imagePath.substring(commaLocation + 1);
258 | final byte[] decodedString = Base64.decode(encodedImage, Base64.DEFAULT);
259 | sourceImage = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);
260 | }
261 | }
262 |
263 | return sourceImage;
264 | }
265 |
266 | /**
267 | * Create a resized version of the given image.
268 | */
269 | public static File createResizedImage(Context context, Uri imageUri, int newWidth,
270 | int newHeight, Bitmap.CompressFormat compressFormat,
271 | int quality, int rotation, String outputPath) throws IOException {
272 | Bitmap sourceImage = null;
273 | String imageUriScheme = imageUri.getScheme();
274 | if (imageUriScheme == null || imageUriScheme.equalsIgnoreCase(SCHEME_FILE) || imageUriScheme.equalsIgnoreCase(SCHEME_CONTENT)) {
275 | sourceImage = ImageResizer.loadBitmapFromFile(context, imageUri, newWidth, newHeight);
276 | } else if (imageUriScheme.equalsIgnoreCase(SCHEME_DATA)) {
277 | sourceImage = ImageResizer.loadBitmapFromBase64(imageUri);
278 | }
279 |
280 | if (sourceImage == null) {
281 | throw new IOException("Unable to load source image from path");
282 | }
283 |
284 | // Scale it first so there are fewer pixels to transform in the rotation
285 | Bitmap scaledImage = ImageResizer.resizeImage(sourceImage, newWidth, newHeight);
286 | if (sourceImage != scaledImage) {
287 | sourceImage.recycle();
288 | }
289 |
290 | // Rotate if necessary
291 | Bitmap rotatedImage = scaledImage;
292 | int orientation = getOrientation(context, imageUri);
293 | rotation = orientation + rotation;
294 | rotatedImage = ImageResizer.rotateImage(scaledImage, rotation);
295 |
296 | if (scaledImage != rotatedImage) {
297 | scaledImage.recycle();
298 | }
299 |
300 | // Save the resulting image
301 | File path = context.getCacheDir();
302 | if (outputPath != null) {
303 | path = new File(outputPath);
304 | }
305 |
306 | File newFile = ImageResizer.saveImage(rotatedImage, path,
307 | Long.toString(new Date().getTime()), compressFormat, quality);
308 |
309 | // Clean up remaining image
310 | rotatedImage.recycle();
311 |
312 | return newFile;
313 | }
314 | }
315 |
--------------------------------------------------------------------------------
/example/ios/ResizerExample.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };
11 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; };
12 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; };
13 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; };
14 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; };
15 | 00E356F31AD99517003FC87E /* ResizerExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ResizerExampleTests.m */; };
16 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; };
17 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; };
18 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; };
19 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
20 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
21 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
22 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
23 | 13F0A79C82084C51A0D98257 /* libRCTImageResizer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 35CA0697315E48458809EE12 /* libRCTImageResizer.a */; };
24 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
25 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
26 | 171A2F6B1EC0BE7600E6FBB0 /* libRCTCameraRoll.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 171A2F6A1EC0BE5900E6FBB0 /* libRCTCameraRoll.a */; };
27 | 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
28 | 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
29 | 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
30 | 2D02E4C21E0B4AEC006451C7 /* libRCTAnimation-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */; };
31 | 2D02E4C31E0B4AEC006451C7 /* libRCTImage-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */; };
32 | 2D02E4C41E0B4AEC006451C7 /* libRCTLinking-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */; };
33 | 2D02E4C51E0B4AEC006451C7 /* libRCTNetwork-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */; };
34 | 2D02E4C61E0B4AEC006451C7 /* libRCTSettings-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */; };
35 | 2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */; };
36 | 2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */; };
37 | 2D02E4C91E0B4AEC006451C7 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3EA31DF850E9000B6D8A /* libReact.a */; };
38 | 2DCD954D1E0B4F2C00145EB5 /* ResizerExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ResizerExampleTests.m */; };
39 | 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; };
40 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
41 | /* End PBXBuildFile section */
42 |
43 | /* Begin PBXContainerItemProxy section */
44 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = {
45 | isa = PBXContainerItemProxy;
46 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;
47 | proxyType = 2;
48 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
49 | remoteInfo = RCTActionSheet;
50 | };
51 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = {
52 | isa = PBXContainerItemProxy;
53 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */;
54 | proxyType = 2;
55 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
56 | remoteInfo = RCTGeolocation;
57 | };
58 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = {
59 | isa = PBXContainerItemProxy;
60 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;
61 | proxyType = 2;
62 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676;
63 | remoteInfo = RCTImage;
64 | };
65 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = {
66 | isa = PBXContainerItemProxy;
67 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;
68 | proxyType = 2;
69 | remoteGlobalIDString = 58B511DB1A9E6C8500147676;
70 | remoteInfo = RCTNetwork;
71 | };
72 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = {
73 | isa = PBXContainerItemProxy;
74 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */;
75 | proxyType = 2;
76 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7;
77 | remoteInfo = RCTVibration;
78 | };
79 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {
80 | isa = PBXContainerItemProxy;
81 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
82 | proxyType = 1;
83 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
84 | remoteInfo = ResizerExample;
85 | };
86 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = {
87 | isa = PBXContainerItemProxy;
88 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
89 | proxyType = 2;
90 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
91 | remoteInfo = RCTSettings;
92 | };
93 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = {
94 | isa = PBXContainerItemProxy;
95 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
96 | proxyType = 2;
97 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A;
98 | remoteInfo = RCTWebSocket;
99 | };
100 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = {
101 | isa = PBXContainerItemProxy;
102 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
103 | proxyType = 2;
104 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192;
105 | remoteInfo = React;
106 | };
107 | 171A2F501EC0BDA800E6FBB0 /* PBXContainerItemProxy */ = {
108 | isa = PBXContainerItemProxy;
109 | containerPortal = BA7F7D45F5054A10A3F5BD18 /* RCTImageResizer.xcodeproj */;
110 | proxyType = 2;
111 | remoteGlobalIDString = 5D72D2E81C16249000E22EC1;
112 | remoteInfo = RCTImageResizer;
113 | };
114 | 171A2F691EC0BE5900E6FBB0 /* PBXContainerItemProxy */ = {
115 | isa = PBXContainerItemProxy;
116 | containerPortal = 171A2F651EC0BE5800E6FBB0 /* RCTCameraRoll.xcodeproj */;
117 | proxyType = 2;
118 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676;
119 | remoteInfo = RCTCameraRoll;
120 | };
121 | 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */ = {
122 | isa = PBXContainerItemProxy;
123 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
124 | proxyType = 1;
125 | remoteGlobalIDString = 2D02E47A1E0B4A5D006451C7;
126 | remoteInfo = "ResizerExample-tvOS";
127 | };
128 | 3DAD3E831DF850E9000B6D8A /* PBXContainerItemProxy */ = {
129 | isa = PBXContainerItemProxy;
130 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;
131 | proxyType = 2;
132 | remoteGlobalIDString = 2D2A283A1D9B042B00D4039D;
133 | remoteInfo = "RCTImage-tvOS";
134 | };
135 | 3DAD3E871DF850E9000B6D8A /* PBXContainerItemProxy */ = {
136 | isa = PBXContainerItemProxy;
137 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;
138 | proxyType = 2;
139 | remoteGlobalIDString = 2D2A28471D9B043800D4039D;
140 | remoteInfo = "RCTLinking-tvOS";
141 | };
142 | 3DAD3E8B1DF850E9000B6D8A /* PBXContainerItemProxy */ = {
143 | isa = PBXContainerItemProxy;
144 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;
145 | proxyType = 2;
146 | remoteGlobalIDString = 2D2A28541D9B044C00D4039D;
147 | remoteInfo = "RCTNetwork-tvOS";
148 | };
149 | 3DAD3E8F1DF850E9000B6D8A /* PBXContainerItemProxy */ = {
150 | isa = PBXContainerItemProxy;
151 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
152 | proxyType = 2;
153 | remoteGlobalIDString = 2D2A28611D9B046600D4039D;
154 | remoteInfo = "RCTSettings-tvOS";
155 | };
156 | 3DAD3E931DF850E9000B6D8A /* PBXContainerItemProxy */ = {
157 | isa = PBXContainerItemProxy;
158 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;
159 | proxyType = 2;
160 | remoteGlobalIDString = 2D2A287B1D9B048500D4039D;
161 | remoteInfo = "RCTText-tvOS";
162 | };
163 | 3DAD3E981DF850E9000B6D8A /* PBXContainerItemProxy */ = {
164 | isa = PBXContainerItemProxy;
165 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
166 | proxyType = 2;
167 | remoteGlobalIDString = 2D2A28881D9B049200D4039D;
168 | remoteInfo = "RCTWebSocket-tvOS";
169 | };
170 | 3DAD3EA21DF850E9000B6D8A /* PBXContainerItemProxy */ = {
171 | isa = PBXContainerItemProxy;
172 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
173 | proxyType = 2;
174 | remoteGlobalIDString = 2D2A28131D9B038B00D4039D;
175 | remoteInfo = "React-tvOS";
176 | };
177 | 3DAD3EA41DF850E9000B6D8A /* PBXContainerItemProxy */ = {
178 | isa = PBXContainerItemProxy;
179 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
180 | proxyType = 2;
181 | remoteGlobalIDString = 3D3C059A1DE3340900C268FA;
182 | remoteInfo = yoga;
183 | };
184 | 3DAD3EA61DF850E9000B6D8A /* PBXContainerItemProxy */ = {
185 | isa = PBXContainerItemProxy;
186 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
187 | proxyType = 2;
188 | remoteGlobalIDString = 3D3C06751DE3340C00C268FA;
189 | remoteInfo = "yoga-tvOS";
190 | };
191 | 3DAD3EA81DF850E9000B6D8A /* PBXContainerItemProxy */ = {
192 | isa = PBXContainerItemProxy;
193 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
194 | proxyType = 2;
195 | remoteGlobalIDString = 3D3CD9251DE5FBEC00167DC4;
196 | remoteInfo = cxxreact;
197 | };
198 | 3DAD3EAA1DF850E9000B6D8A /* PBXContainerItemProxy */ = {
199 | isa = PBXContainerItemProxy;
200 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
201 | proxyType = 2;
202 | remoteGlobalIDString = 3D3CD9321DE5FBEE00167DC4;
203 | remoteInfo = "cxxreact-tvOS";
204 | };
205 | 3DAD3EAC1DF850E9000B6D8A /* PBXContainerItemProxy */ = {
206 | isa = PBXContainerItemProxy;
207 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
208 | proxyType = 2;
209 | remoteGlobalIDString = 3D3CD90B1DE5FBD600167DC4;
210 | remoteInfo = jschelpers;
211 | };
212 | 3DAD3EAE1DF850E9000B6D8A /* PBXContainerItemProxy */ = {
213 | isa = PBXContainerItemProxy;
214 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
215 | proxyType = 2;
216 | remoteGlobalIDString = 3D3CD9181DE5FBD800167DC4;
217 | remoteInfo = "jschelpers-tvOS";
218 | };
219 | 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = {
220 | isa = PBXContainerItemProxy;
221 | containerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */;
222 | proxyType = 2;
223 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
224 | remoteInfo = RCTAnimation;
225 | };
226 | 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = {
227 | isa = PBXContainerItemProxy;
228 | containerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */;
229 | proxyType = 2;
230 | remoteGlobalIDString = 2D2A28201D9B03D100D4039D;
231 | remoteInfo = "RCTAnimation-tvOS";
232 | };
233 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = {
234 | isa = PBXContainerItemProxy;
235 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;
236 | proxyType = 2;
237 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
238 | remoteInfo = RCTLinking;
239 | };
240 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = {
241 | isa = PBXContainerItemProxy;
242 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;
243 | proxyType = 2;
244 | remoteGlobalIDString = 58B5119B1A9E6C1200147676;
245 | remoteInfo = RCTText;
246 | };
247 | /* End PBXContainerItemProxy section */
248 |
249 | /* Begin PBXFileReference section */
250 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; };
251 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; };
252 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; };
253 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; };
254 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; };
255 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; };
256 | 00E356EE1AD99517003FC87E /* ResizerExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ResizerExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
257 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
258 | 00E356F21AD99517003FC87E /* ResizerExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ResizerExampleTests.m; sourceTree = ""; };
259 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; };
260 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; };
261 | 13B07F961A680F5B00A75B9A /* ResizerExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ResizerExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
262 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ResizerExample/AppDelegate.h; sourceTree = ""; };
263 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = ResizerExample/AppDelegate.m; sourceTree = ""; };
264 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
265 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = ResizerExample/Images.xcassets; sourceTree = ""; };
266 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = ResizerExample/Info.plist; sourceTree = ""; };
267 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = ResizerExample/main.m; sourceTree = ""; };
268 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; };
269 | 171A2F651EC0BE5800E6FBB0 /* RCTCameraRoll.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTCameraRoll.xcodeproj; path = "../node_modules/react-native/Libraries/CameraRoll/RCTCameraRoll.xcodeproj"; sourceTree = ""; };
270 | 2D02E47B1E0B4A5D006451C7 /* ResizerExample-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ResizerExample-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
271 | 2D02E4901E0B4A5D006451C7 /* ResizerExample-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ResizerExample-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
272 | 35CA0697315E48458809EE12 /* libRCTImageResizer.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRCTImageResizer.a; sourceTree = ""; };
273 | 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = ""; };
274 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; };
275 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; };
276 | BA7F7D45F5054A10A3F5BD18 /* RCTImageResizer.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RCTImageResizer.xcodeproj; path = "../node_modules/react-native-image-resizer/ios/RCTImageResizer.xcodeproj"; sourceTree = ""; };
277 | /* End PBXFileReference section */
278 |
279 | /* Begin PBXFrameworksBuildPhase section */
280 | 00E356EB1AD99517003FC87E /* Frameworks */ = {
281 | isa = PBXFrameworksBuildPhase;
282 | buildActionMask = 2147483647;
283 | files = (
284 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */,
285 | );
286 | runOnlyForDeploymentPostprocessing = 0;
287 | };
288 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
289 | isa = PBXFrameworksBuildPhase;
290 | buildActionMask = 2147483647;
291 | files = (
292 | 171A2F6B1EC0BE7600E6FBB0 /* libRCTCameraRoll.a in Frameworks */,
293 | 146834051AC3E58100842450 /* libReact.a in Frameworks */,
294 | 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */,
295 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */,
296 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */,
297 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */,
298 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */,
299 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */,
300 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */,
301 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
302 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
303 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
304 | 13F0A79C82084C51A0D98257 /* libRCTImageResizer.a in Frameworks */,
305 | );
306 | runOnlyForDeploymentPostprocessing = 0;
307 | };
308 | 2D02E4781E0B4A5D006451C7 /* Frameworks */ = {
309 | isa = PBXFrameworksBuildPhase;
310 | buildActionMask = 2147483647;
311 | files = (
312 | 2D02E4C91E0B4AEC006451C7 /* libReact.a in Frameworks */,
313 | 2D02E4C21E0B4AEC006451C7 /* libRCTAnimation-tvOS.a in Frameworks */,
314 | 2D02E4C31E0B4AEC006451C7 /* libRCTImage-tvOS.a in Frameworks */,
315 | 2D02E4C41E0B4AEC006451C7 /* libRCTLinking-tvOS.a in Frameworks */,
316 | 2D02E4C51E0B4AEC006451C7 /* libRCTNetwork-tvOS.a in Frameworks */,
317 | 2D02E4C61E0B4AEC006451C7 /* libRCTSettings-tvOS.a in Frameworks */,
318 | 2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */,
319 | 2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */,
320 | );
321 | runOnlyForDeploymentPostprocessing = 0;
322 | };
323 | 2D02E48D1E0B4A5D006451C7 /* Frameworks */ = {
324 | isa = PBXFrameworksBuildPhase;
325 | buildActionMask = 2147483647;
326 | files = (
327 | );
328 | runOnlyForDeploymentPostprocessing = 0;
329 | };
330 | /* End PBXFrameworksBuildPhase section */
331 |
332 | /* Begin PBXGroup section */
333 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = {
334 | isa = PBXGroup;
335 | children = (
336 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */,
337 | );
338 | name = Products;
339 | sourceTree = "";
340 | };
341 | 00C302B61ABCB90400DB3ED1 /* Products */ = {
342 | isa = PBXGroup;
343 | children = (
344 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */,
345 | );
346 | name = Products;
347 | sourceTree = "";
348 | };
349 | 00C302BC1ABCB91800DB3ED1 /* Products */ = {
350 | isa = PBXGroup;
351 | children = (
352 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */,
353 | 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */,
354 | );
355 | name = Products;
356 | sourceTree = "";
357 | };
358 | 00C302D41ABCB9D200DB3ED1 /* Products */ = {
359 | isa = PBXGroup;
360 | children = (
361 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */,
362 | 3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */,
363 | );
364 | name = Products;
365 | sourceTree = "";
366 | };
367 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = {
368 | isa = PBXGroup;
369 | children = (
370 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */,
371 | );
372 | name = Products;
373 | sourceTree = "";
374 | };
375 | 00E356EF1AD99517003FC87E /* ResizerExampleTests */ = {
376 | isa = PBXGroup;
377 | children = (
378 | 00E356F21AD99517003FC87E /* ResizerExampleTests.m */,
379 | 00E356F01AD99517003FC87E /* Supporting Files */,
380 | );
381 | path = ResizerExampleTests;
382 | sourceTree = "";
383 | };
384 | 00E356F01AD99517003FC87E /* Supporting Files */ = {
385 | isa = PBXGroup;
386 | children = (
387 | 00E356F11AD99517003FC87E /* Info.plist */,
388 | );
389 | name = "Supporting Files";
390 | sourceTree = "";
391 | };
392 | 139105B71AF99BAD00B5F7CC /* Products */ = {
393 | isa = PBXGroup;
394 | children = (
395 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */,
396 | 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */,
397 | );
398 | name = Products;
399 | sourceTree = "";
400 | };
401 | 139FDEE71B06529A00C62182 /* Products */ = {
402 | isa = PBXGroup;
403 | children = (
404 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */,
405 | 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */,
406 | );
407 | name = Products;
408 | sourceTree = "";
409 | };
410 | 13B07FAE1A68108700A75B9A /* ResizerExample */ = {
411 | isa = PBXGroup;
412 | children = (
413 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */,
414 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */,
415 | 13B07FB01A68108700A75B9A /* AppDelegate.m */,
416 | 13B07FB51A68108700A75B9A /* Images.xcassets */,
417 | 13B07FB61A68108700A75B9A /* Info.plist */,
418 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */,
419 | 13B07FB71A68108700A75B9A /* main.m */,
420 | );
421 | name = ResizerExample;
422 | sourceTree = "";
423 | };
424 | 146834001AC3E56700842450 /* Products */ = {
425 | isa = PBXGroup;
426 | children = (
427 | 146834041AC3E56700842450 /* libReact.a */,
428 | 3DAD3EA31DF850E9000B6D8A /* libReact.a */,
429 | 3DAD3EA51DF850E9000B6D8A /* libyoga.a */,
430 | 3DAD3EA71DF850E9000B6D8A /* libyoga.a */,
431 | 3DAD3EA91DF850E9000B6D8A /* libcxxreact.a */,
432 | 3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */,
433 | 3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */,
434 | 3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */,
435 | );
436 | name = Products;
437 | sourceTree = "";
438 | };
439 | 171A2F471EC0BDA700E6FBB0 /* Products */ = {
440 | isa = PBXGroup;
441 | children = (
442 | 171A2F511EC0BDA800E6FBB0 /* libRCTImageResizer.a */,
443 | );
444 | name = Products;
445 | sourceTree = "";
446 | };
447 | 171A2F661EC0BE5800E6FBB0 /* Products */ = {
448 | isa = PBXGroup;
449 | children = (
450 | 171A2F6A1EC0BE5900E6FBB0 /* libRCTCameraRoll.a */,
451 | );
452 | name = Products;
453 | sourceTree = "";
454 | };
455 | 5E91572E1DD0AC6500FF2AA8 /* Products */ = {
456 | isa = PBXGroup;
457 | children = (
458 | 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */,
459 | 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */,
460 | );
461 | name = Products;
462 | sourceTree = "";
463 | };
464 | 78C398B11ACF4ADC00677621 /* Products */ = {
465 | isa = PBXGroup;
466 | children = (
467 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */,
468 | 3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */,
469 | );
470 | name = Products;
471 | sourceTree = "";
472 | };
473 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = {
474 | isa = PBXGroup;
475 | children = (
476 | 171A2F651EC0BE5800E6FBB0 /* RCTCameraRoll.xcodeproj */,
477 | 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */,
478 | 146833FF1AC3E56700842450 /* React.xcodeproj */,
479 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */,
480 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */,
481 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */,
482 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */,
483 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */,
484 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */,
485 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
486 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
487 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
488 | BA7F7D45F5054A10A3F5BD18 /* RCTImageResizer.xcodeproj */,
489 | );
490 | name = Libraries;
491 | sourceTree = "";
492 | };
493 | 832341B11AAA6A8300B99B32 /* Products */ = {
494 | isa = PBXGroup;
495 | children = (
496 | 832341B51AAA6A8300B99B32 /* libRCTText.a */,
497 | 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */,
498 | );
499 | name = Products;
500 | sourceTree = "";
501 | };
502 | 83CBB9F61A601CBA00E9B192 = {
503 | isa = PBXGroup;
504 | children = (
505 | 13B07FAE1A68108700A75B9A /* ResizerExample */,
506 | 832341AE1AAA6A7D00B99B32 /* Libraries */,
507 | 00E356EF1AD99517003FC87E /* ResizerExampleTests */,
508 | 83CBBA001A601CBA00E9B192 /* Products */,
509 | );
510 | indentWidth = 2;
511 | sourceTree = "";
512 | tabWidth = 2;
513 | };
514 | 83CBBA001A601CBA00E9B192 /* Products */ = {
515 | isa = PBXGroup;
516 | children = (
517 | 13B07F961A680F5B00A75B9A /* ResizerExample.app */,
518 | 00E356EE1AD99517003FC87E /* ResizerExampleTests.xctest */,
519 | 2D02E47B1E0B4A5D006451C7 /* ResizerExample-tvOS.app */,
520 | 2D02E4901E0B4A5D006451C7 /* ResizerExample-tvOSTests.xctest */,
521 | );
522 | name = Products;
523 | sourceTree = "";
524 | };
525 | /* End PBXGroup section */
526 |
527 | /* Begin PBXNativeTarget section */
528 | 00E356ED1AD99517003FC87E /* ResizerExampleTests */ = {
529 | isa = PBXNativeTarget;
530 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ResizerExampleTests" */;
531 | buildPhases = (
532 | 00E356EA1AD99517003FC87E /* Sources */,
533 | 00E356EB1AD99517003FC87E /* Frameworks */,
534 | 00E356EC1AD99517003FC87E /* Resources */,
535 | );
536 | buildRules = (
537 | );
538 | dependencies = (
539 | 00E356F51AD99517003FC87E /* PBXTargetDependency */,
540 | );
541 | name = ResizerExampleTests;
542 | productName = ResizerExampleTests;
543 | productReference = 00E356EE1AD99517003FC87E /* ResizerExampleTests.xctest */;
544 | productType = "com.apple.product-type.bundle.unit-test";
545 | };
546 | 13B07F861A680F5B00A75B9A /* ResizerExample */ = {
547 | isa = PBXNativeTarget;
548 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ResizerExample" */;
549 | buildPhases = (
550 | 13B07F871A680F5B00A75B9A /* Sources */,
551 | 13B07F8C1A680F5B00A75B9A /* Frameworks */,
552 | 13B07F8E1A680F5B00A75B9A /* Resources */,
553 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
554 | );
555 | buildRules = (
556 | );
557 | dependencies = (
558 | );
559 | name = ResizerExample;
560 | productName = "Hello World";
561 | productReference = 13B07F961A680F5B00A75B9A /* ResizerExample.app */;
562 | productType = "com.apple.product-type.application";
563 | };
564 | 2D02E47A1E0B4A5D006451C7 /* ResizerExample-tvOS */ = {
565 | isa = PBXNativeTarget;
566 | buildConfigurationList = 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "ResizerExample-tvOS" */;
567 | buildPhases = (
568 | 2D02E4771E0B4A5D006451C7 /* Sources */,
569 | 2D02E4781E0B4A5D006451C7 /* Frameworks */,
570 | 2D02E4791E0B4A5D006451C7 /* Resources */,
571 | 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */,
572 | );
573 | buildRules = (
574 | );
575 | dependencies = (
576 | );
577 | name = "ResizerExample-tvOS";
578 | productName = "ResizerExample-tvOS";
579 | productReference = 2D02E47B1E0B4A5D006451C7 /* ResizerExample-tvOS.app */;
580 | productType = "com.apple.product-type.application";
581 | };
582 | 2D02E48F1E0B4A5D006451C7 /* ResizerExample-tvOSTests */ = {
583 | isa = PBXNativeTarget;
584 | buildConfigurationList = 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "ResizerExample-tvOSTests" */;
585 | buildPhases = (
586 | 2D02E48C1E0B4A5D006451C7 /* Sources */,
587 | 2D02E48D1E0B4A5D006451C7 /* Frameworks */,
588 | 2D02E48E1E0B4A5D006451C7 /* Resources */,
589 | );
590 | buildRules = (
591 | );
592 | dependencies = (
593 | 2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */,
594 | );
595 | name = "ResizerExample-tvOSTests";
596 | productName = "ResizerExample-tvOSTests";
597 | productReference = 2D02E4901E0B4A5D006451C7 /* ResizerExample-tvOSTests.xctest */;
598 | productType = "com.apple.product-type.bundle.unit-test";
599 | };
600 | /* End PBXNativeTarget section */
601 |
602 | /* Begin PBXProject section */
603 | 83CBB9F71A601CBA00E9B192 /* Project object */ = {
604 | isa = PBXProject;
605 | attributes = {
606 | LastUpgradeCheck = 610;
607 | ORGANIZATIONNAME = Facebook;
608 | TargetAttributes = {
609 | 00E356ED1AD99517003FC87E = {
610 | CreatedOnToolsVersion = 6.2;
611 | TestTargetID = 13B07F861A680F5B00A75B9A;
612 | };
613 | 2D02E47A1E0B4A5D006451C7 = {
614 | CreatedOnToolsVersion = 8.2.1;
615 | ProvisioningStyle = Automatic;
616 | };
617 | 2D02E48F1E0B4A5D006451C7 = {
618 | CreatedOnToolsVersion = 8.2.1;
619 | ProvisioningStyle = Automatic;
620 | TestTargetID = 2D02E47A1E0B4A5D006451C7;
621 | };
622 | };
623 | };
624 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ResizerExample" */;
625 | compatibilityVersion = "Xcode 3.2";
626 | developmentRegion = English;
627 | hasScannedForEncodings = 0;
628 | knownRegions = (
629 | en,
630 | Base,
631 | );
632 | mainGroup = 83CBB9F61A601CBA00E9B192;
633 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
634 | projectDirPath = "";
635 | projectReferences = (
636 | {
637 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */;
638 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;
639 | },
640 | {
641 | ProductGroup = 5E91572E1DD0AC6500FF2AA8 /* Products */;
642 | ProjectRef = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */;
643 | },
644 | {
645 | ProductGroup = 171A2F661EC0BE5800E6FBB0 /* Products */;
646 | ProjectRef = 171A2F651EC0BE5800E6FBB0 /* RCTCameraRoll.xcodeproj */;
647 | },
648 | {
649 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */;
650 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */;
651 | },
652 | {
653 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */;
654 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;
655 | },
656 | {
657 | ProductGroup = 171A2F471EC0BDA700E6FBB0 /* Products */;
658 | ProjectRef = BA7F7D45F5054A10A3F5BD18 /* RCTImageResizer.xcodeproj */;
659 | },
660 | {
661 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */;
662 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;
663 | },
664 | {
665 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */;
666 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;
667 | },
668 | {
669 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */;
670 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
671 | },
672 | {
673 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */;
674 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;
675 | },
676 | {
677 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */;
678 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */;
679 | },
680 | {
681 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */;
682 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
683 | },
684 | {
685 | ProductGroup = 146834001AC3E56700842450 /* Products */;
686 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;
687 | },
688 | );
689 | projectRoot = "";
690 | targets = (
691 | 13B07F861A680F5B00A75B9A /* ResizerExample */,
692 | 00E356ED1AD99517003FC87E /* ResizerExampleTests */,
693 | 2D02E47A1E0B4A5D006451C7 /* ResizerExample-tvOS */,
694 | 2D02E48F1E0B4A5D006451C7 /* ResizerExample-tvOSTests */,
695 | );
696 | };
697 | /* End PBXProject section */
698 |
699 | /* Begin PBXReferenceProxy section */
700 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = {
701 | isa = PBXReferenceProxy;
702 | fileType = archive.ar;
703 | path = libRCTActionSheet.a;
704 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */;
705 | sourceTree = BUILT_PRODUCTS_DIR;
706 | };
707 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = {
708 | isa = PBXReferenceProxy;
709 | fileType = archive.ar;
710 | path = libRCTGeolocation.a;
711 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */;
712 | sourceTree = BUILT_PRODUCTS_DIR;
713 | };
714 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = {
715 | isa = PBXReferenceProxy;
716 | fileType = archive.ar;
717 | path = libRCTImage.a;
718 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */;
719 | sourceTree = BUILT_PRODUCTS_DIR;
720 | };
721 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = {
722 | isa = PBXReferenceProxy;
723 | fileType = archive.ar;
724 | path = libRCTNetwork.a;
725 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */;
726 | sourceTree = BUILT_PRODUCTS_DIR;
727 | };
728 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = {
729 | isa = PBXReferenceProxy;
730 | fileType = archive.ar;
731 | path = libRCTVibration.a;
732 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */;
733 | sourceTree = BUILT_PRODUCTS_DIR;
734 | };
735 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = {
736 | isa = PBXReferenceProxy;
737 | fileType = archive.ar;
738 | path = libRCTSettings.a;
739 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */;
740 | sourceTree = BUILT_PRODUCTS_DIR;
741 | };
742 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = {
743 | isa = PBXReferenceProxy;
744 | fileType = archive.ar;
745 | path = libRCTWebSocket.a;
746 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */;
747 | sourceTree = BUILT_PRODUCTS_DIR;
748 | };
749 | 146834041AC3E56700842450 /* libReact.a */ = {
750 | isa = PBXReferenceProxy;
751 | fileType = archive.ar;
752 | path = libReact.a;
753 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */;
754 | sourceTree = BUILT_PRODUCTS_DIR;
755 | };
756 | 171A2F511EC0BDA800E6FBB0 /* libRCTImageResizer.a */ = {
757 | isa = PBXReferenceProxy;
758 | fileType = archive.ar;
759 | path = libRCTImageResizer.a;
760 | remoteRef = 171A2F501EC0BDA800E6FBB0 /* PBXContainerItemProxy */;
761 | sourceTree = BUILT_PRODUCTS_DIR;
762 | };
763 | 171A2F6A1EC0BE5900E6FBB0 /* libRCTCameraRoll.a */ = {
764 | isa = PBXReferenceProxy;
765 | fileType = archive.ar;
766 | path = libRCTCameraRoll.a;
767 | remoteRef = 171A2F691EC0BE5900E6FBB0 /* PBXContainerItemProxy */;
768 | sourceTree = BUILT_PRODUCTS_DIR;
769 | };
770 | 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */ = {
771 | isa = PBXReferenceProxy;
772 | fileType = archive.ar;
773 | path = "libRCTImage-tvOS.a";
774 | remoteRef = 3DAD3E831DF850E9000B6D8A /* PBXContainerItemProxy */;
775 | sourceTree = BUILT_PRODUCTS_DIR;
776 | };
777 | 3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */ = {
778 | isa = PBXReferenceProxy;
779 | fileType = archive.ar;
780 | path = "libRCTLinking-tvOS.a";
781 | remoteRef = 3DAD3E871DF850E9000B6D8A /* PBXContainerItemProxy */;
782 | sourceTree = BUILT_PRODUCTS_DIR;
783 | };
784 | 3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */ = {
785 | isa = PBXReferenceProxy;
786 | fileType = archive.ar;
787 | path = "libRCTNetwork-tvOS.a";
788 | remoteRef = 3DAD3E8B1DF850E9000B6D8A /* PBXContainerItemProxy */;
789 | sourceTree = BUILT_PRODUCTS_DIR;
790 | };
791 | 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */ = {
792 | isa = PBXReferenceProxy;
793 | fileType = archive.ar;
794 | path = "libRCTSettings-tvOS.a";
795 | remoteRef = 3DAD3E8F1DF850E9000B6D8A /* PBXContainerItemProxy */;
796 | sourceTree = BUILT_PRODUCTS_DIR;
797 | };
798 | 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */ = {
799 | isa = PBXReferenceProxy;
800 | fileType = archive.ar;
801 | path = "libRCTText-tvOS.a";
802 | remoteRef = 3DAD3E931DF850E9000B6D8A /* PBXContainerItemProxy */;
803 | sourceTree = BUILT_PRODUCTS_DIR;
804 | };
805 | 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */ = {
806 | isa = PBXReferenceProxy;
807 | fileType = archive.ar;
808 | path = "libRCTWebSocket-tvOS.a";
809 | remoteRef = 3DAD3E981DF850E9000B6D8A /* PBXContainerItemProxy */;
810 | sourceTree = BUILT_PRODUCTS_DIR;
811 | };
812 | 3DAD3EA31DF850E9000B6D8A /* libReact.a */ = {
813 | isa = PBXReferenceProxy;
814 | fileType = archive.ar;
815 | path = libReact.a;
816 | remoteRef = 3DAD3EA21DF850E9000B6D8A /* PBXContainerItemProxy */;
817 | sourceTree = BUILT_PRODUCTS_DIR;
818 | };
819 | 3DAD3EA51DF850E9000B6D8A /* libyoga.a */ = {
820 | isa = PBXReferenceProxy;
821 | fileType = archive.ar;
822 | path = libyoga.a;
823 | remoteRef = 3DAD3EA41DF850E9000B6D8A /* PBXContainerItemProxy */;
824 | sourceTree = BUILT_PRODUCTS_DIR;
825 | };
826 | 3DAD3EA71DF850E9000B6D8A /* libyoga.a */ = {
827 | isa = PBXReferenceProxy;
828 | fileType = archive.ar;
829 | path = libyoga.a;
830 | remoteRef = 3DAD3EA61DF850E9000B6D8A /* PBXContainerItemProxy */;
831 | sourceTree = BUILT_PRODUCTS_DIR;
832 | };
833 | 3DAD3EA91DF850E9000B6D8A /* libcxxreact.a */ = {
834 | isa = PBXReferenceProxy;
835 | fileType = archive.ar;
836 | path = libcxxreact.a;
837 | remoteRef = 3DAD3EA81DF850E9000B6D8A /* PBXContainerItemProxy */;
838 | sourceTree = BUILT_PRODUCTS_DIR;
839 | };
840 | 3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */ = {
841 | isa = PBXReferenceProxy;
842 | fileType = archive.ar;
843 | path = libcxxreact.a;
844 | remoteRef = 3DAD3EAA1DF850E9000B6D8A /* PBXContainerItemProxy */;
845 | sourceTree = BUILT_PRODUCTS_DIR;
846 | };
847 | 3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */ = {
848 | isa = PBXReferenceProxy;
849 | fileType = archive.ar;
850 | path = libjschelpers.a;
851 | remoteRef = 3DAD3EAC1DF850E9000B6D8A /* PBXContainerItemProxy */;
852 | sourceTree = BUILT_PRODUCTS_DIR;
853 | };
854 | 3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */ = {
855 | isa = PBXReferenceProxy;
856 | fileType = archive.ar;
857 | path = libjschelpers.a;
858 | remoteRef = 3DAD3EAE1DF850E9000B6D8A /* PBXContainerItemProxy */;
859 | sourceTree = BUILT_PRODUCTS_DIR;
860 | };
861 | 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */ = {
862 | isa = PBXReferenceProxy;
863 | fileType = archive.ar;
864 | path = libRCTAnimation.a;
865 | remoteRef = 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */;
866 | sourceTree = BUILT_PRODUCTS_DIR;
867 | };
868 | 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */ = {
869 | isa = PBXReferenceProxy;
870 | fileType = archive.ar;
871 | path = "libRCTAnimation-tvOS.a";
872 | remoteRef = 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */;
873 | sourceTree = BUILT_PRODUCTS_DIR;
874 | };
875 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = {
876 | isa = PBXReferenceProxy;
877 | fileType = archive.ar;
878 | path = libRCTLinking.a;
879 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */;
880 | sourceTree = BUILT_PRODUCTS_DIR;
881 | };
882 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = {
883 | isa = PBXReferenceProxy;
884 | fileType = archive.ar;
885 | path = libRCTText.a;
886 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */;
887 | sourceTree = BUILT_PRODUCTS_DIR;
888 | };
889 | /* End PBXReferenceProxy section */
890 |
891 | /* Begin PBXResourcesBuildPhase section */
892 | 00E356EC1AD99517003FC87E /* Resources */ = {
893 | isa = PBXResourcesBuildPhase;
894 | buildActionMask = 2147483647;
895 | files = (
896 | );
897 | runOnlyForDeploymentPostprocessing = 0;
898 | };
899 | 13B07F8E1A680F5B00A75B9A /* Resources */ = {
900 | isa = PBXResourcesBuildPhase;
901 | buildActionMask = 2147483647;
902 | files = (
903 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
904 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
905 | );
906 | runOnlyForDeploymentPostprocessing = 0;
907 | };
908 | 2D02E4791E0B4A5D006451C7 /* Resources */ = {
909 | isa = PBXResourcesBuildPhase;
910 | buildActionMask = 2147483647;
911 | files = (
912 | 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */,
913 | );
914 | runOnlyForDeploymentPostprocessing = 0;
915 | };
916 | 2D02E48E1E0B4A5D006451C7 /* Resources */ = {
917 | isa = PBXResourcesBuildPhase;
918 | buildActionMask = 2147483647;
919 | files = (
920 | );
921 | runOnlyForDeploymentPostprocessing = 0;
922 | };
923 | /* End PBXResourcesBuildPhase section */
924 |
925 | /* Begin PBXShellScriptBuildPhase section */
926 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
927 | isa = PBXShellScriptBuildPhase;
928 | buildActionMask = 2147483647;
929 | files = (
930 | );
931 | inputPaths = (
932 | );
933 | name = "Bundle React Native code and images";
934 | outputPaths = (
935 | );
936 | runOnlyForDeploymentPostprocessing = 0;
937 | shellPath = /bin/sh;
938 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh";
939 | };
940 | 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = {
941 | isa = PBXShellScriptBuildPhase;
942 | buildActionMask = 2147483647;
943 | files = (
944 | );
945 | inputPaths = (
946 | );
947 | name = "Bundle React Native Code And Images";
948 | outputPaths = (
949 | );
950 | runOnlyForDeploymentPostprocessing = 0;
951 | shellPath = /bin/sh;
952 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh";
953 | };
954 | /* End PBXShellScriptBuildPhase section */
955 |
956 | /* Begin PBXSourcesBuildPhase section */
957 | 00E356EA1AD99517003FC87E /* Sources */ = {
958 | isa = PBXSourcesBuildPhase;
959 | buildActionMask = 2147483647;
960 | files = (
961 | 00E356F31AD99517003FC87E /* ResizerExampleTests.m in Sources */,
962 | );
963 | runOnlyForDeploymentPostprocessing = 0;
964 | };
965 | 13B07F871A680F5B00A75B9A /* Sources */ = {
966 | isa = PBXSourcesBuildPhase;
967 | buildActionMask = 2147483647;
968 | files = (
969 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
970 | 13B07FC11A68108700A75B9A /* main.m in Sources */,
971 | );
972 | runOnlyForDeploymentPostprocessing = 0;
973 | };
974 | 2D02E4771E0B4A5D006451C7 /* Sources */ = {
975 | isa = PBXSourcesBuildPhase;
976 | buildActionMask = 2147483647;
977 | files = (
978 | 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */,
979 | 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */,
980 | );
981 | runOnlyForDeploymentPostprocessing = 0;
982 | };
983 | 2D02E48C1E0B4A5D006451C7 /* Sources */ = {
984 | isa = PBXSourcesBuildPhase;
985 | buildActionMask = 2147483647;
986 | files = (
987 | 2DCD954D1E0B4F2C00145EB5 /* ResizerExampleTests.m in Sources */,
988 | );
989 | runOnlyForDeploymentPostprocessing = 0;
990 | };
991 | /* End PBXSourcesBuildPhase section */
992 |
993 | /* Begin PBXTargetDependency section */
994 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = {
995 | isa = PBXTargetDependency;
996 | target = 13B07F861A680F5B00A75B9A /* ResizerExample */;
997 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;
998 | };
999 | 2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */ = {
1000 | isa = PBXTargetDependency;
1001 | target = 2D02E47A1E0B4A5D006451C7 /* ResizerExample-tvOS */;
1002 | targetProxy = 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */;
1003 | };
1004 | /* End PBXTargetDependency section */
1005 |
1006 | /* Begin PBXVariantGroup section */
1007 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = {
1008 | isa = PBXVariantGroup;
1009 | children = (
1010 | 13B07FB21A68108700A75B9A /* Base */,
1011 | );
1012 | name = LaunchScreen.xib;
1013 | path = ResizerExample;
1014 | sourceTree = "";
1015 | };
1016 | /* End PBXVariantGroup section */
1017 |
1018 | /* Begin XCBuildConfiguration section */
1019 | 00E356F61AD99517003FC87E /* Debug */ = {
1020 | isa = XCBuildConfiguration;
1021 | buildSettings = {
1022 | BUNDLE_LOADER = "$(TEST_HOST)";
1023 | GCC_PREPROCESSOR_DEFINITIONS = (
1024 | "DEBUG=1",
1025 | "$(inherited)",
1026 | );
1027 | INFOPLIST_FILE = ResizerExampleTests/Info.plist;
1028 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1029 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1030 | LIBRARY_SEARCH_PATHS = (
1031 | "$(inherited)",
1032 | "\"$(SRCROOT)/$(TARGET_NAME)\"",
1033 | );
1034 | OTHER_LDFLAGS = (
1035 | "-ObjC",
1036 | "-lc++",
1037 | );
1038 | PRODUCT_NAME = "$(TARGET_NAME)";
1039 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ResizerExample.app/ResizerExample";
1040 | };
1041 | name = Debug;
1042 | };
1043 | 00E356F71AD99517003FC87E /* Release */ = {
1044 | isa = XCBuildConfiguration;
1045 | buildSettings = {
1046 | BUNDLE_LOADER = "$(TEST_HOST)";
1047 | COPY_PHASE_STRIP = NO;
1048 | INFOPLIST_FILE = ResizerExampleTests/Info.plist;
1049 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1050 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1051 | LIBRARY_SEARCH_PATHS = (
1052 | "$(inherited)",
1053 | "\"$(SRCROOT)/$(TARGET_NAME)\"",
1054 | );
1055 | OTHER_LDFLAGS = (
1056 | "-ObjC",
1057 | "-lc++",
1058 | );
1059 | PRODUCT_NAME = "$(TARGET_NAME)";
1060 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ResizerExample.app/ResizerExample";
1061 | };
1062 | name = Release;
1063 | };
1064 | 13B07F941A680F5B00A75B9A /* Debug */ = {
1065 | isa = XCBuildConfiguration;
1066 | buildSettings = {
1067 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
1068 | CURRENT_PROJECT_VERSION = 1;
1069 | DEAD_CODE_STRIPPING = NO;
1070 | INFOPLIST_FILE = ResizerExample/Info.plist;
1071 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
1072 | OTHER_LDFLAGS = (
1073 | "$(inherited)",
1074 | "-ObjC",
1075 | "-lc++",
1076 | );
1077 | PRODUCT_NAME = ResizerExample;
1078 | VERSIONING_SYSTEM = "apple-generic";
1079 | };
1080 | name = Debug;
1081 | };
1082 | 13B07F951A680F5B00A75B9A /* Release */ = {
1083 | isa = XCBuildConfiguration;
1084 | buildSettings = {
1085 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
1086 | CURRENT_PROJECT_VERSION = 1;
1087 | INFOPLIST_FILE = ResizerExample/Info.plist;
1088 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
1089 | OTHER_LDFLAGS = (
1090 | "$(inherited)",
1091 | "-ObjC",
1092 | "-lc++",
1093 | );
1094 | PRODUCT_NAME = ResizerExample;
1095 | VERSIONING_SYSTEM = "apple-generic";
1096 | };
1097 | name = Release;
1098 | };
1099 | 2D02E4971E0B4A5E006451C7 /* Debug */ = {
1100 | isa = XCBuildConfiguration;
1101 | buildSettings = {
1102 | ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
1103 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
1104 | CLANG_ANALYZER_NONNULL = YES;
1105 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
1106 | CLANG_WARN_INFINITE_RECURSION = YES;
1107 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
1108 | DEBUG_INFORMATION_FORMAT = dwarf;
1109 | ENABLE_TESTABILITY = YES;
1110 | GCC_NO_COMMON_BLOCKS = YES;
1111 | INFOPLIST_FILE = "ResizerExample-tvOS/Info.plist";
1112 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
1113 | LIBRARY_SEARCH_PATHS = (
1114 | "$(inherited)",
1115 | "\"$(SRCROOT)/$(TARGET_NAME)\"",
1116 | );
1117 | OTHER_LDFLAGS = (
1118 | "-ObjC",
1119 | "-lc++",
1120 | );
1121 | PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.ResizerExample-tvOS";
1122 | PRODUCT_NAME = "$(TARGET_NAME)";
1123 | SDKROOT = appletvos;
1124 | TARGETED_DEVICE_FAMILY = 3;
1125 | TVOS_DEPLOYMENT_TARGET = 9.2;
1126 | };
1127 | name = Debug;
1128 | };
1129 | 2D02E4981E0B4A5E006451C7 /* Release */ = {
1130 | isa = XCBuildConfiguration;
1131 | buildSettings = {
1132 | ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
1133 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
1134 | CLANG_ANALYZER_NONNULL = YES;
1135 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
1136 | CLANG_WARN_INFINITE_RECURSION = YES;
1137 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
1138 | COPY_PHASE_STRIP = NO;
1139 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
1140 | GCC_NO_COMMON_BLOCKS = YES;
1141 | INFOPLIST_FILE = "ResizerExample-tvOS/Info.plist";
1142 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
1143 | LIBRARY_SEARCH_PATHS = (
1144 | "$(inherited)",
1145 | "\"$(SRCROOT)/$(TARGET_NAME)\"",
1146 | );
1147 | OTHER_LDFLAGS = (
1148 | "-ObjC",
1149 | "-lc++",
1150 | );
1151 | PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.ResizerExample-tvOS";
1152 | PRODUCT_NAME = "$(TARGET_NAME)";
1153 | SDKROOT = appletvos;
1154 | TARGETED_DEVICE_FAMILY = 3;
1155 | TVOS_DEPLOYMENT_TARGET = 9.2;
1156 | };
1157 | name = Release;
1158 | };
1159 | 2D02E4991E0B4A5E006451C7 /* Debug */ = {
1160 | isa = XCBuildConfiguration;
1161 | buildSettings = {
1162 | BUNDLE_LOADER = "$(TEST_HOST)";
1163 | CLANG_ANALYZER_NONNULL = YES;
1164 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
1165 | CLANG_WARN_INFINITE_RECURSION = YES;
1166 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
1167 | DEBUG_INFORMATION_FORMAT = dwarf;
1168 | ENABLE_TESTABILITY = YES;
1169 | GCC_NO_COMMON_BLOCKS = YES;
1170 | INFOPLIST_FILE = "ResizerExample-tvOSTests/Info.plist";
1171 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1172 | LIBRARY_SEARCH_PATHS = (
1173 | "$(inherited)",
1174 | "\"$(SRCROOT)/$(TARGET_NAME)\"",
1175 | );
1176 | PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.ResizerExample-tvOSTests";
1177 | PRODUCT_NAME = "$(TARGET_NAME)";
1178 | SDKROOT = appletvos;
1179 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ResizerExample-tvOS.app/ResizerExample-tvOS";
1180 | TVOS_DEPLOYMENT_TARGET = 10.1;
1181 | };
1182 | name = Debug;
1183 | };
1184 | 2D02E49A1E0B4A5E006451C7 /* Release */ = {
1185 | isa = XCBuildConfiguration;
1186 | buildSettings = {
1187 | BUNDLE_LOADER = "$(TEST_HOST)";
1188 | CLANG_ANALYZER_NONNULL = YES;
1189 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
1190 | CLANG_WARN_INFINITE_RECURSION = YES;
1191 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
1192 | COPY_PHASE_STRIP = NO;
1193 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
1194 | GCC_NO_COMMON_BLOCKS = YES;
1195 | INFOPLIST_FILE = "ResizerExample-tvOSTests/Info.plist";
1196 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1197 | LIBRARY_SEARCH_PATHS = (
1198 | "$(inherited)",
1199 | "\"$(SRCROOT)/$(TARGET_NAME)\"",
1200 | );
1201 | PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.ResizerExample-tvOSTests";
1202 | PRODUCT_NAME = "$(TARGET_NAME)";
1203 | SDKROOT = appletvos;
1204 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ResizerExample-tvOS.app/ResizerExample-tvOS";
1205 | TVOS_DEPLOYMENT_TARGET = 10.1;
1206 | };
1207 | name = Release;
1208 | };
1209 | 83CBBA201A601CBA00E9B192 /* Debug */ = {
1210 | isa = XCBuildConfiguration;
1211 | buildSettings = {
1212 | ALWAYS_SEARCH_USER_PATHS = NO;
1213 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
1214 | CLANG_CXX_LIBRARY = "libc++";
1215 | CLANG_ENABLE_MODULES = YES;
1216 | CLANG_ENABLE_OBJC_ARC = YES;
1217 | CLANG_WARN_BOOL_CONVERSION = YES;
1218 | CLANG_WARN_CONSTANT_CONVERSION = YES;
1219 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
1220 | CLANG_WARN_EMPTY_BODY = YES;
1221 | CLANG_WARN_ENUM_CONVERSION = YES;
1222 | CLANG_WARN_INT_CONVERSION = YES;
1223 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
1224 | CLANG_WARN_UNREACHABLE_CODE = YES;
1225 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
1226 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1227 | COPY_PHASE_STRIP = NO;
1228 | ENABLE_STRICT_OBJC_MSGSEND = YES;
1229 | GCC_C_LANGUAGE_STANDARD = gnu99;
1230 | GCC_DYNAMIC_NO_PIC = NO;
1231 | GCC_OPTIMIZATION_LEVEL = 0;
1232 | GCC_PREPROCESSOR_DEFINITIONS = (
1233 | "DEBUG=1",
1234 | "$(inherited)",
1235 | );
1236 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
1237 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
1238 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
1239 | GCC_WARN_UNDECLARED_SELECTOR = YES;
1240 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
1241 | GCC_WARN_UNUSED_FUNCTION = YES;
1242 | GCC_WARN_UNUSED_VARIABLE = YES;
1243 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1244 | MTL_ENABLE_DEBUG_INFO = YES;
1245 | ONLY_ACTIVE_ARCH = YES;
1246 | SDKROOT = iphoneos;
1247 | };
1248 | name = Debug;
1249 | };
1250 | 83CBBA211A601CBA00E9B192 /* Release */ = {
1251 | isa = XCBuildConfiguration;
1252 | buildSettings = {
1253 | ALWAYS_SEARCH_USER_PATHS = NO;
1254 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
1255 | CLANG_CXX_LIBRARY = "libc++";
1256 | CLANG_ENABLE_MODULES = YES;
1257 | CLANG_ENABLE_OBJC_ARC = YES;
1258 | CLANG_WARN_BOOL_CONVERSION = YES;
1259 | CLANG_WARN_CONSTANT_CONVERSION = YES;
1260 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
1261 | CLANG_WARN_EMPTY_BODY = YES;
1262 | CLANG_WARN_ENUM_CONVERSION = YES;
1263 | CLANG_WARN_INT_CONVERSION = YES;
1264 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
1265 | CLANG_WARN_UNREACHABLE_CODE = YES;
1266 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
1267 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1268 | COPY_PHASE_STRIP = YES;
1269 | ENABLE_NS_ASSERTIONS = NO;
1270 | ENABLE_STRICT_OBJC_MSGSEND = YES;
1271 | GCC_C_LANGUAGE_STANDARD = gnu99;
1272 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
1273 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
1274 | GCC_WARN_UNDECLARED_SELECTOR = YES;
1275 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
1276 | GCC_WARN_UNUSED_FUNCTION = YES;
1277 | GCC_WARN_UNUSED_VARIABLE = YES;
1278 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1279 | MTL_ENABLE_DEBUG_INFO = NO;
1280 | SDKROOT = iphoneos;
1281 | VALIDATE_PRODUCT = YES;
1282 | };
1283 | name = Release;
1284 | };
1285 | /* End XCBuildConfiguration section */
1286 |
1287 | /* Begin XCConfigurationList section */
1288 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ResizerExampleTests" */ = {
1289 | isa = XCConfigurationList;
1290 | buildConfigurations = (
1291 | 00E356F61AD99517003FC87E /* Debug */,
1292 | 00E356F71AD99517003FC87E /* Release */,
1293 | );
1294 | defaultConfigurationIsVisible = 0;
1295 | defaultConfigurationName = Release;
1296 | };
1297 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ResizerExample" */ = {
1298 | isa = XCConfigurationList;
1299 | buildConfigurations = (
1300 | 13B07F941A680F5B00A75B9A /* Debug */,
1301 | 13B07F951A680F5B00A75B9A /* Release */,
1302 | );
1303 | defaultConfigurationIsVisible = 0;
1304 | defaultConfigurationName = Release;
1305 | };
1306 | 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "ResizerExample-tvOS" */ = {
1307 | isa = XCConfigurationList;
1308 | buildConfigurations = (
1309 | 2D02E4971E0B4A5E006451C7 /* Debug */,
1310 | 2D02E4981E0B4A5E006451C7 /* Release */,
1311 | );
1312 | defaultConfigurationIsVisible = 0;
1313 | defaultConfigurationName = Release;
1314 | };
1315 | 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "ResizerExample-tvOSTests" */ = {
1316 | isa = XCConfigurationList;
1317 | buildConfigurations = (
1318 | 2D02E4991E0B4A5E006451C7 /* Debug */,
1319 | 2D02E49A1E0B4A5E006451C7 /* Release */,
1320 | );
1321 | defaultConfigurationIsVisible = 0;
1322 | defaultConfigurationName = Release;
1323 | };
1324 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ResizerExample" */ = {
1325 | isa = XCConfigurationList;
1326 | buildConfigurations = (
1327 | 83CBBA201A601CBA00E9B192 /* Debug */,
1328 | 83CBBA211A601CBA00E9B192 /* Release */,
1329 | );
1330 | defaultConfigurationIsVisible = 0;
1331 | defaultConfigurationName = Release;
1332 | };
1333 | /* End XCConfigurationList section */
1334 | };
1335 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
1336 | }
1337 |
--------------------------------------------------------------------------------