Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions related with memcached, OpenJPEG and Kakadu #252

Open
pWoz opened this issue Feb 28, 2023 · 7 comments
Open

Questions related with memcached, OpenJPEG and Kakadu #252

pWoz opened this issue Feb 28, 2023 · 7 comments

Comments

@pWoz
Copy link

pWoz commented Feb 28, 2023

Hi,

I'm going to setup IIPServer installation by compiling the source code. I have some doubts/questions:

  1. I would like to use memcached. I installed it and run on my machine (listen on 127.0.0.1:11211) but while running './configure' I get:

Options Enabled:

Memcached : false
JPEG2000 : true (OpenJPEG)
OpenMP : true
Loggers : file, syslog

Does it mean that memcache will not be used by compiled IIP Server? How to make it work?

  1. I would like to test performance of IIP Server for both OpenJPG and Kakadu codecs. I already have OpenJPEG libs installed and my current machine, IIP Server works fine (but quite slow).
    How it will work if I will have both OpenJPEG and Kakadu codecs installed on the machine? Which one will be used?
    Maybe for Kakadu case I should just download already compiled version?

Regards,
Pawel

@ruven
Copy link
Owner

ruven commented Feb 28, 2023

Hi Pawel,

  1. To use memcached, you need to first install the libmemcached library (the libmemcached-dev package if you're using Debian or Ubuntu). The configure script should then indicate true for Memcached

  2. To test both JPEG2000 codecs, you need to build 2 separate versions of iipsrv - one compiled with OpenJPEG and one compiled with Kakadu. For OpenJPEG, this will all work by default. To build with Kakadu, make a copy of your iipsrv source directory and run configure with the --with-kakadu parameter.

./configure --with-kakadu=/path/to/kakadu/sources

Then test each iipsrv.fcgi binary separately. Note that you will need to point to the Kakadu source code directory, not to any pre-compiled binaries as iipsrv needs access to certain header files. Also don't forget to make sure the path to the Kakadu .so library is in the LD_LIBRARY_PATH for the process that runs the iipsrv.fcgi binary.

Kakadu is certainly much faster than OpenJPEG, but is of course not open source.

@pWoz
Copy link
Author

pWoz commented Feb 28, 2023

Thank You very much for help.

I have CentOS 7, I installed libmemcached-devel and now configure script indicates true for Memcached;

I have several additional questions:

  1. According to the blog post here: https://iipimage.sourceforge.io/2019/06/iipsrv-1-1-released/
    iipsrv should be available in repository. But I cannot find it for Centos 7.
    https://pkgs.org/search/?q=iip
    Am I doing something wrong?

  2. What codec (OpenJPEG or Kakadu) will be used if I will just install iipsrv directly using default package manager (for both 1.0 and 1.1 versions if differs) for different combinations;

  • both OpenJPEG or Kakadu installed on machine;
  • only OpenJPEG installed on machine;
  • only Kakadu installed on machine;
  1. Do You have any experience with Grok codecs, regarding performance compared to Kakadu?

@ruven
Copy link
Owner

ruven commented Feb 28, 2023

It's here in Fedora: https://packages.fedoraproject.org/pkgs/iipsrv/iipsrv/
But for CentOS you need to add the EPEL package repository: https://docs.fedoraproject.org/en-US/epel/
However, although it was included in earlier releases, it looks like it's not been included in EPEL 9 for some reason.

If you install iipsrv directly using the package manager, it will always use OpenJPEG regardless of whether you have Kakadu installed or not.

Grok was originally a fork of OpenJPEG, but has since changed it's API and cannot now be used with iipsrv. It's had a lot of work on performance making it faster than OpenJPEG, but it remains slower than Kakadu. Although it cannot be used with iipsrv, you could still use it for faster encoding of your JPEG2000 files.

@pWoz
Copy link
Author

pWoz commented Mar 1, 2023

Last one question (for now), if I may ask:
My iipsrv doesn't generate logs. Here is my config:

DefaultInitEnv VERBOSITY "5"
DefaultInitEnv LOGFILE "/tmp/iipsrv.log"

from here:

/etc/httpd/conf.d/iipsrv.conf

It works properly (logs are generated) when I run iipsrv as a standalone application:
iipsrv.fcgi --bind 192.168.0.1:9000 --backlog 1024
but it doesn't when I run it via httpd.

@ruven
Copy link
Owner

ruven commented Mar 1, 2023

You are probably running iipsrv in standalone mode or through httpd as different users. If so, the iipsrv.log file may not be writable by the httpd process. The easiest way to resolve this is just to make the log file read-writable by all users:

chmod 666 /tmp/iipsrv.log

@pWoz
Copy link
Author

pWoz commented Mar 16, 2023

Thank You very much for all your support. Now I have another issue (with Kakadu this time). I compiled Kakadu on the machine and confugired iipsrv with --with-kakadu parameter:

configure: Kakadu is >= v7.5
checking for /home/centos/v8_3-02147E/apps/make/supp_local.o... yes
configure: Kakadu is >= v7.10
Options Enabled:
 Memcached  :  true
 JPEG2000   :  true (Kakadu)
 OpenMP     :  true
 Loggers    :  file, syslog

but when I try to compile iipsrv I get the following error:


KakaduImage.cc: In member function ‘virtual void KakaduImage::loadImageInfo(int, int)’:
KakaduImage.cc:222:54: error: no matching function for call to ‘kdu_supp::jp2_channels::get_colour_mapping(int, int&, int&, int&)’
   j2k_channels.get_colour_mapping(0,cmp,plt,stream_id);
                                                      ^
KakaduImage.cc:222:54: note: candidate is:
In file included from /home/centos/v8_3-02147E/managed/all_includes/jpx.h:39:0,
                 from KakaduImage.h:38,
                 from KakaduImage.cc:29:
/home/centos/v8_3-02147E/managed/all_includes/jp2.h:3735:7: note: bool kdu_supp::jp2_channels::get_colour_mapping(int, int&, int&, int&, int&, int*) const
       get_colour_mapping(int colour_idx, int &codestream_component,
       ^
/home/centos/v8_3-02147E/managed/all_includes/jp2.h:3735:7: note:   candidate expects 6 arguments, 4 provided

Do You know how I can solve it?

@ruven
Copy link
Owner

ruven commented Mar 16, 2023

Which version of iipsrv are you using? Version 1.1? If so, the latest Kakadu has some API changes, so make sure you use the latest source code from Github and it should compile without issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants