Skip to content

Commit 71f930c

Browse files
committed
fix: * fix #26 adapt rn v0.58
* fix #25 iOS multi timeop make image size incorrect * fix #24 allow output name self definition
1 parent 9d66972 commit 71f930c

File tree

7 files changed

+98
-91
lines changed

7 files changed

+98
-91
lines changed

android/src/main/java/com/jimmydaddy/imagemarker/ImageMarkerManager.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import com.facebook.react.bridge.ReactContextBaseJavaModule;
2929
import com.facebook.react.bridge.ReactMethod;
3030
import com.facebook.react.bridge.ReadableMap;
31+
import com.facebook.react.bridge.WritableMap;
3132
import com.facebook.react.views.text.ReactFontManager;
3233

3334
import java.io.BufferedOutputStream;
@@ -101,7 +102,7 @@ private void markImage(
101102

102103
File file = new File(preImgPath);
103104
if (!file.exists()){
104-
promise.reject( "imgSavePath error","Can't retrieve the file from the imgSavePath: " + imgSavePath,null);
105+
promise.reject( "imgSavePath error","Can't retrieve the file from the imgSavePath: " + imgSavePath);
105106
return;
106107
}
107108

@@ -125,20 +126,20 @@ public void onNewResultImpl(@Nullable Bitmap bitmap) {
125126
String preImgPath = myUri.getPath();
126127
markImageByBitmap(preImgPath, mark, position, X, Y, scale, quality, filename, promise);
127128
} else {
128-
promise.reject( "marker error","Can't retrieve the file from the markerpath: " + uri,null);
129+
promise.reject( "marker error","Can't retrieve the file from the markerpath: " + uri);
129130
}
130131
}
131132

132133
@Override
133134
public void onFailureImpl(DataSource dataSource) {
134-
promise.reject( "error","Can't request the image from the uri: " + uri,null);
135+
promise.reject( "error","Can't request the image from the uri: " + uri);
135136
}
136137
}, executor);
137138
} else {
138139
int resId = getDrawableResourceByName(uri);
139140
if (resId == 0) {
140141
Log.d(IMAGE_MARKER_TAG, "cannot find res");
141-
promise.reject( "error","Can't get resource by the path: " + uri,null);
142+
promise.reject( "error","Can't get resource by the path: " + uri);
142143
} else {
143144
Log.d(IMAGE_MARKER_TAG, "res:" + resId);
144145

@@ -287,7 +288,7 @@ public void addText(
287288
Promise promise
288289
) {
289290
if (TextUtils.isEmpty(mark)){
290-
promise.reject("error", "mark should not be empty", null);
291+
promise.reject("error", "mark should not be empty");
291292
}
292293
BufferedOutputStream bos = null;
293294
boolean isFinished;
@@ -301,7 +302,7 @@ public void addText(
301302

302303
File file = new File(preImgPath);
303304
if (!file.exists()){
304-
promise.reject( "error","Can't retrieve the file from the path.",null);
305+
promise.reject( "error","Can't retrieve the file from the path.");
305306
return;
306307
}
307308
Bitmap prePhoto = Utils.scaleBitmap(preImgPath, scale);
@@ -414,7 +415,7 @@ public void addTextByPostion(
414415
Promise promise
415416
) {
416417
if (TextUtils.isEmpty(mark)){
417-
promise.reject("error", "mark should not be empty", null);
418+
promise.reject("error", "mark should not be empty");
418419
}
419420
BufferedOutputStream bos = null;
420421
boolean isFinished;
@@ -426,7 +427,7 @@ public void addTextByPostion(
426427

427428
File file = new File(preImgPath);
428429
if (!file.exists()){
429-
promise.reject( "error","Can't retrieve the file from the path.",null);
430+
promise.reject( "error","Can't retrieve the file from the path.");
430431
return;
431432
}
432433
Bitmap prePhoto = Utils.scaleBitmap(preImgPath, scale);

example/markerExample/App.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,8 @@ export default class MarkerTest extends React.Component {
152152
markerSrc: this.state.marker,
153153
position: type,
154154
scale: 1,
155-
markerScale: 0.5,
156-
quality: 100,
157-
filename: 'markerfile1'
155+
markerScale: 1,
156+
quality: 100
158157
}).then((path) => {
159158
console.log('====================================');
160159
console.log(path);
@@ -230,8 +229,7 @@ export default class MarkerTest extends React.Component {
230229
fontName: 'Arial-BoldItalicMT',
231230
fontSize: 44,
232231
scale: 1,
233-
quality: 100,
234-
filename: 'markerfile4'
232+
quality: 100
235233
}).then((path) => {
236234
console.log('====================================');
237235
console.log(path);

example/markerExample/ios/markerExample.xcodeproj/project.pbxproj

Lines changed: 68 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
6D98A830D8424447A153CB07 /* libRCTImageMarker.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C6D82152CCC0428D9D98BCC1 /* libRCTImageMarker.a */; };
4040
79615464FDE547BC844C6D5C /* libRNImagePicker.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 67D5C7074B7749BAA5E8156A /* libRNImagePicker.a */; };
4141
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
42+
A14A02E622112EFC001E2004 /* libstdc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = A14A02B622112EFC001E2004 /* libstdc++.tbd */; };
43+
A14A02E8221131C4001E2004 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A14A02E7221131C4001E2004 /* JavaScriptCore.framework */; };
4244
ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; };
4345
/* End PBXBuildFile section */
4446

@@ -176,20 +178,6 @@
176178
remoteGlobalIDString = 3D383D621EBD27B9005632C8;
177179
remoteInfo = "double-conversion-tvOS";
178180
};
179-
2DF0FFEA2056DD460020B375 /* PBXContainerItemProxy */ = {
180-
isa = PBXContainerItemProxy;
181-
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
182-
proxyType = 2;
183-
remoteGlobalIDString = 9936F3131F5F2E4B0010BF04;
184-
remoteInfo = privatedata;
185-
};
186-
2DF0FFEC2056DD460020B375 /* PBXContainerItemProxy */ = {
187-
isa = PBXContainerItemProxy;
188-
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
189-
proxyType = 2;
190-
remoteGlobalIDString = 9936F32F1F5F2E5B0010BF04;
191-
remoteInfo = "privatedata-tvOS";
192-
};
193181
3DAD3E831DF850E9000B6D8A /* PBXContainerItemProxy */ = {
194182
isa = PBXContainerItemProxy;
195183
containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;
@@ -267,20 +255,6 @@
267255
remoteGlobalIDString = 3D3CD9321DE5FBEE00167DC4;
268256
remoteInfo = "cxxreact-tvOS";
269257
};
270-
3DAD3EAC1DF850E9000B6D8A /* PBXContainerItemProxy */ = {
271-
isa = PBXContainerItemProxy;
272-
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
273-
proxyType = 2;
274-
remoteGlobalIDString = 3D3CD90B1DE5FBD600167DC4;
275-
remoteInfo = jschelpers;
276-
};
277-
3DAD3EAE1DF850E9000B6D8A /* PBXContainerItemProxy */ = {
278-
isa = PBXContainerItemProxy;
279-
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
280-
proxyType = 2;
281-
remoteGlobalIDString = 3D3CD9181DE5FBD800167DC4;
282-
remoteInfo = "jschelpers-tvOS";
283-
};
284258
5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = {
285259
isa = PBXContainerItemProxy;
286260
containerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */;
@@ -309,6 +283,34 @@
309283
remoteGlobalIDString = 58B5119B1A9E6C1200147676;
310284
remoteInfo = RCTText;
311285
};
286+
A14A02DD22112EFC001E2004 /* PBXContainerItemProxy */ = {
287+
isa = PBXContainerItemProxy;
288+
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
289+
proxyType = 2;
290+
remoteGlobalIDString = EDEBC6D6214B3E7000DD5AC8;
291+
remoteInfo = jsi;
292+
};
293+
A14A02DF22112EFC001E2004 /* PBXContainerItemProxy */ = {
294+
isa = PBXContainerItemProxy;
295+
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
296+
proxyType = 2;
297+
remoteGlobalIDString = EDEBC73B214B45A300DD5AC8;
298+
remoteInfo = jsiexecutor;
299+
};
300+
A14A02E122112EFC001E2004 /* PBXContainerItemProxy */ = {
301+
isa = PBXContainerItemProxy;
302+
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
303+
proxyType = 2;
304+
remoteGlobalIDString = ED296FB6214C9A0900B7C4FE;
305+
remoteInfo = "jsi-tvOS";
306+
};
307+
A14A02E322112EFC001E2004 /* PBXContainerItemProxy */ = {
308+
isa = PBXContainerItemProxy;
309+
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
310+
proxyType = 2;
311+
remoteGlobalIDString = ED296FEE214C9CF800B7C4FE;
312+
remoteInfo = "jsiexecutor-tvOS";
313+
};
312314
A15CD72621DD206E00A9EE1B /* PBXContainerItemProxy */ = {
313315
isa = PBXContainerItemProxy;
314316
containerPortal = A2EA32D95A5D4E0F8EF58BFC /* RCTImageMarker.xcodeproj */;
@@ -359,6 +361,8 @@
359361
67D5C7074B7749BAA5E8156A /* libRNImagePicker.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNImagePicker.a; sourceTree = "<group>"; };
360362
78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
361363
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
364+
A14A02B622112EFC001E2004 /* libstdc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libstdc++.tbd"; path = "usr/lib/libstdc++.tbd"; sourceTree = SDKROOT; };
365+
A14A02E7221131C4001E2004 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
362366
A2EA32D95A5D4E0F8EF58BFC /* RCTImageMarker.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RCTImageMarker.xcodeproj; path = "../node_modules/react-native-image-marker/ios/RCTImageMarker.xcodeproj"; sourceTree = "<group>"; };
363367
ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = "<group>"; };
364368
C6D82152CCC0428D9D98BCC1 /* libRCTImageMarker.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRCTImageMarker.a; sourceTree = "<group>"; };
@@ -378,6 +382,8 @@
378382
isa = PBXFrameworksBuildPhase;
379383
buildActionMask = 2147483647;
380384
files = (
385+
A14A02E8221131C4001E2004 /* JavaScriptCore.framework in Frameworks */,
386+
A14A02E622112EFC001E2004 /* libstdc++.tbd in Frameworks */,
381387
ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */,
382388
11D1A2F320CAFA9E000508D9 /* libRCTAnimation.a in Frameworks */,
383389
146834051AC3E58100842450 /* libReact.a in Frameworks */,
@@ -523,23 +529,25 @@
523529
3DAD3EA71DF850E9000B6D8A /* libyoga.a */,
524530
3DAD3EA91DF850E9000B6D8A /* libcxxreact.a */,
525531
3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */,
526-
3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */,
527-
3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */,
528532
2DF0FFDF2056DD460020B375 /* libjsinspector.a */,
529533
2DF0FFE12056DD460020B375 /* libjsinspector-tvOS.a */,
530534
2DF0FFE32056DD460020B375 /* libthird-party.a */,
531535
2DF0FFE52056DD460020B375 /* libthird-party.a */,
532536
2DF0FFE72056DD460020B375 /* libdouble-conversion.a */,
533537
2DF0FFE92056DD460020B375 /* libdouble-conversion.a */,
534-
2DF0FFEB2056DD460020B375 /* libprivatedata.a */,
535-
2DF0FFED2056DD460020B375 /* libprivatedata-tvOS.a */,
538+
A14A02DE22112EFC001E2004 /* libjsi.a */,
539+
A14A02E022112EFC001E2004 /* libjsiexecutor.a */,
540+
A14A02E222112EFC001E2004 /* libjsi-tvOS.a */,
541+
A14A02E422112EFC001E2004 /* libjsiexecutor-tvOS.a */,
536542
);
537543
name = Products;
538544
sourceTree = "<group>";
539545
};
540546
2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
541547
isa = PBXGroup;
542548
children = (
549+
A14A02E7221131C4001E2004 /* JavaScriptCore.framework */,
550+
A14A02B622112EFC001E2004 /* libstdc++.tbd */,
543551
2D16E6891FA4F8E400B85C8A /* libReact.a */,
544552
);
545553
name = Frameworks;
@@ -951,20 +959,6 @@
951959
remoteRef = 2DF0FFE82056DD460020B375 /* PBXContainerItemProxy */;
952960
sourceTree = BUILT_PRODUCTS_DIR;
953961
};
954-
2DF0FFEB2056DD460020B375 /* libprivatedata.a */ = {
955-
isa = PBXReferenceProxy;
956-
fileType = archive.ar;
957-
path = libprivatedata.a;
958-
remoteRef = 2DF0FFEA2056DD460020B375 /* PBXContainerItemProxy */;
959-
sourceTree = BUILT_PRODUCTS_DIR;
960-
};
961-
2DF0FFED2056DD460020B375 /* libprivatedata-tvOS.a */ = {
962-
isa = PBXReferenceProxy;
963-
fileType = archive.ar;
964-
path = "libprivatedata-tvOS.a";
965-
remoteRef = 2DF0FFEC2056DD460020B375 /* PBXContainerItemProxy */;
966-
sourceTree = BUILT_PRODUCTS_DIR;
967-
};
968962
3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */ = {
969963
isa = PBXReferenceProxy;
970964
fileType = archive.ar;
@@ -1042,20 +1036,6 @@
10421036
remoteRef = 3DAD3EAA1DF850E9000B6D8A /* PBXContainerItemProxy */;
10431037
sourceTree = BUILT_PRODUCTS_DIR;
10441038
};
1045-
3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */ = {
1046-
isa = PBXReferenceProxy;
1047-
fileType = archive.ar;
1048-
path = libjschelpers.a;
1049-
remoteRef = 3DAD3EAC1DF850E9000B6D8A /* PBXContainerItemProxy */;
1050-
sourceTree = BUILT_PRODUCTS_DIR;
1051-
};
1052-
3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */ = {
1053-
isa = PBXReferenceProxy;
1054-
fileType = archive.ar;
1055-
path = libjschelpers.a;
1056-
remoteRef = 3DAD3EAE1DF850E9000B6D8A /* PBXContainerItemProxy */;
1057-
sourceTree = BUILT_PRODUCTS_DIR;
1058-
};
10591039
5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */ = {
10601040
isa = PBXReferenceProxy;
10611041
fileType = archive.ar;
@@ -1084,6 +1064,34 @@
10841064
remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */;
10851065
sourceTree = BUILT_PRODUCTS_DIR;
10861066
};
1067+
A14A02DE22112EFC001E2004 /* libjsi.a */ = {
1068+
isa = PBXReferenceProxy;
1069+
fileType = archive.ar;
1070+
path = libjsi.a;
1071+
remoteRef = A14A02DD22112EFC001E2004 /* PBXContainerItemProxy */;
1072+
sourceTree = BUILT_PRODUCTS_DIR;
1073+
};
1074+
A14A02E022112EFC001E2004 /* libjsiexecutor.a */ = {
1075+
isa = PBXReferenceProxy;
1076+
fileType = archive.ar;
1077+
path = libjsiexecutor.a;
1078+
remoteRef = A14A02DF22112EFC001E2004 /* PBXContainerItemProxy */;
1079+
sourceTree = BUILT_PRODUCTS_DIR;
1080+
};
1081+
A14A02E222112EFC001E2004 /* libjsi-tvOS.a */ = {
1082+
isa = PBXReferenceProxy;
1083+
fileType = archive.ar;
1084+
path = "libjsi-tvOS.a";
1085+
remoteRef = A14A02E122112EFC001E2004 /* PBXContainerItemProxy */;
1086+
sourceTree = BUILT_PRODUCTS_DIR;
1087+
};
1088+
A14A02E422112EFC001E2004 /* libjsiexecutor-tvOS.a */ = {
1089+
isa = PBXReferenceProxy;
1090+
fileType = archive.ar;
1091+
path = "libjsiexecutor-tvOS.a";
1092+
remoteRef = A14A02E322112EFC001E2004 /* PBXContainerItemProxy */;
1093+
sourceTree = BUILT_PRODUCTS_DIR;
1094+
};
10871095
A15CD72721DD206E00A9EE1B /* libRCTImageMarker.a */ = {
10881096
isa = PBXReferenceProxy;
10891097
fileType = archive.ar;

example/markerExample/ios/markerExample.xcodeproj/xcshareddata/xcschemes/markerExample.xcscheme

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@
8181
</TestAction>
8282
<LaunchAction
8383
buildConfiguration = "Debug"
84-
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
85-
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
84+
selectedDebuggerIdentifier = ""
85+
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
8686
launchStyle = "0"
8787
useCustomWorkingDirectory = "NO"
8888
ignoresPersistentStateOnLaunch = "NO"

example/markerExample/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
"test": "jest"
88
},
99
"dependencies": {
10-
"react": "16.6.3",
11-
"react-native": "0.57.8",
12-
"react-native-image-marker": "^0.3.9",
10+
"react": "16.8.1",
11+
"react-native": "^0.58.4",
12+
"react-native-image-marker": "^0.4.0",
1313
"react-native-image-picker": "^0.27.2"
1414
},
1515
"devDependencies": {

0 commit comments

Comments
 (0)