Skip to content

Commit 1bc6edb

Browse files
committed
fix: convert isFront and rotateImage to string to correctly pass them to the frame processors
1 parent f30f863 commit 1bc6edb

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

android/src/main/java/com/visioncameradynamsoftbarcodereader/VisionCameraDBRPlugin.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,14 @@ public Object callback(@NonNull Frame frame, @Nullable Map<String, Object> argum
4040
Boolean rotateImage = true;
4141
if (arguments != null ){
4242
if (arguments.containsKey("isFront")){
43-
isFront = (Boolean) arguments.get("isFront");
43+
if (((String) arguments.get("isFront")).equals("true")){
44+
isFront = true;
45+
}
4446
}
4547
if (arguments.containsKey("rotateImage")){
46-
rotateImage = (Boolean) arguments.get("rotateImage");
48+
if (((String) arguments.get("rotateImage")).equals("false")){
49+
rotateImage = false;
50+
}
4751
}
4852
initLicense(arguments);
4953
updateRuntimeSettingsWithTemplate(arguments);

src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ export function decode(frame: Frame,config?:DBRConfig):TextResult[]|undefined {
3030
if (config) {
3131
let record:Record<string,any> = {};
3232
if (config.isFront) {
33-
record["isFront"] = config.isFront;
33+
record["isFront"] = config.isFront.toString();
3434
}
3535
if (config.rotateImage) {
36-
record["rotateImage"] = config.rotateImage;
36+
record["rotateImage"] = config.rotateImage.toString();
3737
}
3838
if (config.template) {
3939
record["template"] = config.template;

0 commit comments

Comments
 (0)