nativescript-photo-editor icon indicating copy to clipboard operation
nativescript-photo-editor copied to clipboard

Application slow during 5 seconds after editPhoto

Open Serge-SDL opened this issue 6 years ago • 7 comments

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!

Serge-SDL avatar Dec 03 '18 13:12 Serge-SDL

Hey @Serge-SDL , can you provide a reproducible sample of the problem? Also is this angular or non-angular app?

PeterStaev avatar Dec 09 '18 17:12 PeterStaev

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!

Serge-SDL avatar Dec 10 '18 11:12 Serge-SDL

Hello @PeterStaev ! do you succeed reproducing the issue?

Serge-SDL avatar Jan 04 '19 10:01 Serge-SDL

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 😞

PeterStaev avatar Jan 04 '19 19:01 PeterStaev

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!

Serge-SDL avatar Feb 11 '19 16:02 Serge-SDL

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 😃

PeterStaev avatar Feb 11 '19 16:02 PeterStaev

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...

Serge-SDL avatar Feb 12 '19 12:02 Serge-SDL