Access image from worker thread without saving image as file into device


#1

i want to resize images with worker but I dont want to save image temporary into device and sent its path to worker, there is other way to access images from worker?


#2

As of now, communication between workers supports only JSON object and creating multiple workers can mess with your performance as each worker will load it’s own instance of run time.

But still worker is good if you wisely use it. In case if you need more control over threading, you might want to write native code for each platform.


#3

@manojdcoder native code in swift and java?


#4

When I say native code, it’s JavaScript / TypeScript version of Objective C / Java code.

If you feel familiar with Swift / Java you can still use that too and invoke them from JavaScript.


#5

@manojdcoder
I’m little confused, what do you mean by /javascript version of Objective C ? there are some examples how to write and use native code?
I need to see to understand.

I found this but I’m not sure if it is a what i’m looking for:
https://docs.nativescript.org/runtimes/ios/types/ObjC-Classes#inheriting-native-classes-in-javascript
thanks.


#6

iOS: https://docs.nativescript.org/runtimes/ios/marshalling/Marshalling-Overview
Android: https://docs.nativescript.org/runtimes/android/marshalling/java-to-js