nativescript-photo-editor
nativescript-photo-editor copied to clipboard
Application slow during 5 seconds after editPhoto
Hello,
I try to use NsPhotoEditor and I dot an issue on android: I have just added this test code:
photoEditor.editPhoto({
imageSource: imageSource,
hiddenControls: [],
}).then((newImage: ImageSource) => {
console.log('NEW IMAGE: ', newImage.height, newImage.width);
// that.savePictureSource(newImage);
}).catch((e) => {
console.error(e);
});
(nothing done after photoEditor task) but when I go back to the current page, app is slow during 5 seconds: If I put a TextField in the page, the keybord takes around 5 seconds to be displayed.
Do You have any idea to improve this ? Thanks!
Hey @Serge-SDL , can you provide a reproducible sample of the problem? Also is this angular or non-angular app?
Hey @PeterStaev,
here are the step to reproduce the issue:
- clone master from: https://bitbucket.org/sdlab/drawing-test/src/master/
- go to folder and launch with npm run android (its a web/mobile shared project)
- click on "Take Picture"
- click on "Take picture with drawing"
- validate the photo edition (no need to perform anything) -> when you go back on initial form its like frozen for a couple of seconds. you cant scroll or show keybord.
if you do the same without the photo editor part (take picture without drawing), its works fine. Test performed on a samsung A5. tell me if you need more information!
thanks!
Hello @PeterStaev ! do you succeed reproducing the issue?
Hey @Serge-SDL , sadly I have very limited free time lately to spend on my plugins. So I did not have a chance to look at this yet, and dont have any ETA to do so 😞
Hey @PeterStaev !
I realy need your plugin so I spend a few more hours to find the minimal code to reproduce the issue. I found that angular related, not problem on pure Nativescript and I opened an issue on nativescript angular github here: https://github.com/NativeScript/nativescript-angular/issues/1726
If you have any idea with these new informations, I'll be glad!
Hey @Serge-SDL , could it be some zone related error? Since lately i have been doing many web angular work this is the most cases when there is some delay in refreshing the UI. May be try to run the code in the promise callbacks inside Angular zone with this.zone.run()
and see if it will make any difference. This is just a wild guess 😃
Hey @PeterStaev , thanks for your answer! Unfortunately tried several things with zone run(), runOutsideAngular() ... but it didn't work. Also try to use workers but I think it's not possible to launch/manage UI from worker...