4 Replies Latest reply on Oct 5, 2014 7:48 PM by TigrouMeow

    How to avoid LrStringUtils.encodeBase64 and LrFileUtils.readFile to block the main thread?

    TigrouMeow Level 1



      When publishing the photos, I am using LrFileUtils.readFile to read the exported file and LrStringUtils.encodeBase64 on the result of it. Those two functions are the only ones in my process that seems to block the main thread of LR.


      I tried to put those two functions in an asynchronous task by using LrTasks.startAsyncTask() and LrTasks.yield() to wait for the task to be done but LR UI is still freezing for 1 or 2 seconds when I execute those functions.


      Is this normal? Am I doing it wrong? Is there any way I can avoid that?


      Thanks a lot!