@oguzhnatly/react-native-image-manipulator 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ ## 1.0.1
2
+
3
+ - Typescript module declaration added.
4
+
5
+ ## 1.0.0
6
+
7
+ - Initial release of the @oguzhnatly/react-native-image-manipulator package.
package/README.md CHANGED
@@ -1,4 +1,40 @@
1
- ### `ImageManipulator.manipulate(uri, actions, saveOptions)`
1
+ ## Getting started
2
+
3
+ `$ npm install @oguzhnatly/react-native-image-manipulator --save`
4
+ ### OR
5
+ `$ yarn add @oguzhnatly/react-native-image-manipulator`
6
+
7
+ ### Mostly automatic installation
8
+
9
+ `$ react-native link react-native-image-manipulator`
10
+
11
+ ### Manual installation
12
+
13
+ #### iOS
14
+
15
+ 1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`
16
+ 2. Go to `node_modules` ➜ `@oguzhnatly` ➜ `react-native-image-manipulator` and add `RNImageManipulator.xcodeproj`
17
+ 3. In XCode, in the project navigator, select your project. Add `libRNImageManipulator.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`
18
+ 4. Run your project (`Cmd+R`)<
19
+
20
+ #### Android
21
+
22
+ 1. Open up `android/app/src/main/java/[...]/MainActivity.java`
23
+
24
+ - Add `import com.reactnativeimagemanipulator.RNImageManipulatorPackage;` to the imports at the top of the file
25
+ - Add `new RNImageManipulatorPackage()` to the list returned by the `getPackages()` method
26
+
27
+ 2. Append the following lines to `android/settings.gradle`:
28
+ ```
29
+ include ':react-native-image-manipulator'
30
+ project(':react-native-image-manipulator').projectDir = new File(rootProject.projectDir, '../node_modules/@oguzhnatly/react-native-image-manipulator/android')
31
+ ```
32
+ 3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
33
+ ```
34
+ compile project(':react-native-image-manipulator')
35
+ ```
36
+
37
+ ### `RNImageManipulator.manipulate(uri, actions, saveOptions)`
2
38
 
3
39
  Manipulate the image provided via `uri`. Available modifications are rotating, flipping (mirroring), resizing and cropping. Each invocation results in a new file. With one invocation you can provide a set of actions to perform over the image. Overwriting the source file would not have an effect in displaying the result as images are cached.
4
40
 
@@ -30,7 +66,7 @@ This will first rotate the image 90 degrees clockwise, then flip the rotated ima
30
66
  ```javascript
31
67
  import React from "react";
32
68
  import { Button, TouchableOpacity, Text, View, Image } from "react-native";
33
- import ImageManipulator from "react-native-image-manipulator";
69
+ import RNImageManipulator from "@oguzhnatly/react-native-image-manipulator";
34
70
 
35
71
  import Colors from "../constants/Colors";
36
72
 
@@ -63,7 +99,7 @@ export default class ImageManipulatorSample extends React.Component {
63
99
  }
64
100
 
65
101
  _rotate90andFlip = async () => {
66
- const manipResult = await ImageManipulator.manipulate(
102
+ const manipResult = await RNImageManipulator.manipulate(
67
103
  this.state.image.localUri || this.state.image.uri,
68
104
  [{ rotate: 90 }, { flip: { vertical: true } }],
69
105
  { format: "png" }
@@ -88,40 +124,4 @@ export default class ImageManipulatorSample extends React.Component {
88
124
  );
89
125
  };
90
126
  }
91
- ```
92
-
93
- ## Getting started
94
-
95
- `$ npm install @oguzhnatly/react-native-image-manipulator --save`
96
- ### OR
97
- `$ yarn add @oguzhnatly/react-native-image-manipulator`
98
-
99
- ### Mostly automatic installation
100
-
101
- `$ react-native link react-native-image-manipulator`
102
-
103
- ### Manual installation
104
-
105
- #### iOS
106
-
107
- 1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`
108
- 2. Go to `node_modules` ➜ `react-native-image-manipulator` and add `RNImageManipulator.xcodeproj`
109
- 3. In XCode, in the project navigator, select your project. Add `libRNImageManipulator.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`
110
- 4. Run your project (`Cmd+R`)<
111
-
112
- #### Android
113
-
114
- 1. Open up `android/app/src/main/java/[...]/MainActivity.java`
115
-
116
- - Add `import com.reactnativeimagemanipulator.RNImageManipulatorPackage;` to the imports at the top of the file
117
- - Add `new RNImageManipulatorPackage()` to the list returned by the `getPackages()` method
118
-
119
- 2. Append the following lines to `android/settings.gradle`:
120
- ```
121
- include ':react-native-image-manipulator'
122
- project(':react-native-image-manipulator').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-manipulator/android')
123
- ```
124
- 3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
125
- ```
126
- compile project(':react-native-image-manipulator')
127
- ```
127
+ ```
package/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ declare module 'RNImageManipulator';
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@oguzhnatly/react-native-image-manipulator",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "ImageManipulator for react native without Expo and Unimodules. Based on Expo ImageManipulator",
5
5
  "main": "index.js",
6
6
  "author": "oguzhnatly",
7
7
  "homepage": "https://github.com/oguzhnatly/react-native-image-manipulator",
8
- "license": "MIT"
8
+ "license": "MIT",
9
+ "typings": "index.d.ts"
9
10
  }