Orthanc compression

504 views
Skip to first unread message

cir...@gmail.com

unread,
Sep 12, 2015, 12:56:33 PM9/12/15
to Orthanc Users
Is there a way to setup compression for already stored images?

The problem is that image import with onfly compression is very slow (about 4-5 Mb/s) and processor expensive so I want to setup delayed compression for old images which should be executed when system isnt busy (at weekends).

Sébastien Jodogne

unread,
Sep 14, 2015, 4:12:51 AM9/14/15
to Orthanc Users, cir...@gmail.com
Hello,

Thanks for your message. This is not currently possible, but I have just added a task on the roadmap:

Sébastien-

cir...@gmail.com

unread,
Sep 14, 2015, 1:10:36 PM9/14/15
to Orthanc Users, cir...@gmail.com
Thanks for response. Hope my disks pace will come out after new release)

Are there any drawbacks if I compress file with zlib and then alter 'compressiontype' to 2,'compressionhash' and 'compressionsize' columns in the 'attachedfiles' table?

Are there any special parameters of zlib compression?

Sébastien Jodogne

unread,
Sep 15, 2015, 3:28:27 AM9/15/15
to Orthanc Users, cir...@gmail.com
Do not do this: The compressed files correspond to zlib-encoded files, but they are prefixed by a 64-bit integer that contains the size of the uncompressed file. It is highly dangerous to manually modify the SQLite database.

I would rather strongly suggest you to replicate your current instance of Orthanc into a fresh instance of Orthanc in which storage compression is disabled:

You might also be interested in the following maintenance tool that can decompress the files that are stored in the "OrthancStorage" directory:

Sébastien-

Sébastien Jodogne

unread,
Oct 9, 2015, 11:27:48 AM10/9/15
to Orthanc Users, cir...@gmail.com
This feature is now part of the Orthanc mainline [1], and will be included in forthcoming release 0.9.5.

Each attachment is now associated with 3 additional URIs: "compress" (to compress using zlib), "uncompress", and "is-compressed" (will return "0" or "1" depending on whether the attachment is compressed).

Sample integration tests are also available to illustrate this behavior (in "test_compression") [2].

HTH,
Sébastien-


Reply all
Reply to author
Forward
0 new messages