Getting error when combining compression with transfers accelerator

Hi Team!

I am trying to compress incoming images using J2K (AutomatedJpeg2kCompression.lua), and then once the study is stable, send it via the transfers accelerator plugin (From Sebastian’s code - https://groups.google.com/g/orthanc-users/c/lxmHpqiwF6o/m/dRLdUDANCAAJ).

But I am getting errors on using both these codes together. I included both the lua files in my config.json file. Each is working well independently, but together they lead to two main issues:

  1. Both old (uncompressed) and new (compressed) images being stored on the sender side.
  2. Some image compression failing
    I am attaching the codes and the error log.

Any guidance would be deeply appreciated. Thank you!

PS: I have already tried googling and searching within the forums and have not found any similar thread. If there is one, please do point me towards it, and I will try to troubleshoot to the best of my abilities.

shareCompress.lua (1.64 KB)

shareSend.lua (515 Bytes)

Orthanc.log.20211205-011822.216 (13.1 KB)

Hi Elvis,

You should first try to understand where these error messages come from:
E1205 04:47:19.421006 LuaScripting.cpp:417] Lua: Unknown resource
E1205 04:47:19.421006 LuaScripting.cpp:420] Lua: Error in RestApiGet() for URI: /instances/f781125a-4a88d6ec-62a42122-47f461ec-54ee8bd1/file
E1205 04:47:19.423005 OrthancException.h:76] Cannot execute a Lua command: [string “line”]:17: bad argument #1 to ‘write’ (string expected, got nil)
E1205 04:47:19.424007 LuaScripting.cpp:772] Error while processing Lua events: Cannot execute a Lua command

Looks like the files are not there when you request them.

I would recommend first enabling verbose logging and add a few print statements in your lua code.

HTH,

Alain