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

Add JPEG 2000 support with OpenJPEG #74

Merged
merged 18 commits into from
Jul 29, 2016
Merged

Conversation

stweil
Copy link
Contributor

@stweil stweil commented Jul 9, 2016

This PR is similar to PR #61, but based on latest git master and with three new commits on top.

stweil added 17 commits July 9, 2016 14:28
These files from git@github.com:moravianlibrary/iipsrv-openjpeg.git
are needed to support JPEG 2000 using libopenjpeg instead of Kakadu.

Information from the original commit:

commit 9262068b8606c2a0699ee74fad4ec991d34c7715
Author: Daniel Secik <dsecik@gmail.com>
Date:   Tue Jun 9 18:04:46 2015 +0200

    Initial commit

Signed-off-by: Stefan Weil <sw@weilnetz.de>
* Remove whitespace at line endings

* Remove empty line at end of file

Signed-off-by: Stefan Weil <sw@weilnetz.de>
See this discussion:
moravianlibrary/iipsrv-openjpeg#1

Signed-off-by: Stefan Weil <sw@weilnetz.de>
* Update OpenJPEGImage::openImage for latest iipsrv.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
* Add check for OpenJPEG JPEG2000 library (code mainly from
  moravianlibrary/iipsrv-openjpeg).

* Use Kakadu by default (if available). OpenJPEG can be enforced by
  setting the environment variable USE_OPENJPEG=1.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
gcc reports these warnings:

src/OpenJPEGImage.cc:174:14: warning:
 comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(; tmp_w > tile_width || tmp_h > tile_height; ++i){
              ^
src/OpenJPEGImage.cc:174:36: warning:
 comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(; tmp_w > tile_width || tmp_h > tile_height; ++i){
                                    ^
As raster_width, raster_height, tile_width and tile_height all are
unsigned values, tmp_w and tmp_h should also be unsigned.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
gcc reports these warnings:

src/OpenJPEGImage.cc:241:7: warning:
 variable ‘edge_x’ set but not used [-Wunused-but-set-variable]
  bool edge_x = false; // Alter the tile size if it's in the last column
       ^
src/OpenJPEGImage.cc:247:7: warning:
 variable ‘edge_y’ set but not used [-Wunused-but-set-variable]
  bool edge_y = false; // Alter the tile size if it's in the bottom row

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
It now uses std::invalid_argument and a new derived file_error
exception

See also commit e79cf0e.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
The global variable logfile is already declared in the .h file.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
@boxerab
Copy link

boxerab commented Jul 9, 2016

👍

@boxerab
Copy link

boxerab commented Jul 16, 2016

@ruven do you think this PR is ready for merging, or is there more work that needs to be done?

@ruven
Copy link
Owner

ruven commented Jul 19, 2016

It's good, but I see that there's still the unnecessary useOpenJPEG boolean. Remove this and I'll do the merge.

Now it is no longer possible to build a binary which supports both
JPEG 2000 libraries. The JPEG 2000 library must be chosen when
running configure. There is a preference for the Kakadu library.
OpenJPEG can be enabled with the configure option --enable-openjpeg.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
@stweil
Copy link
Contributor Author

stweil commented Jul 19, 2016

Done. All code and comments related to useOpenJPEG are removed now.

@boxerab
Copy link

boxerab commented Jul 25, 2016

@ruven how does the PR look to you now? Also, once this gets merged, what is the best way of notifying users about the new feature ? IIIF Discuss google group ?

@ruven ruven merged commit 4d10067 into ruven:master Jul 29, 2016
@ruven
Copy link
Owner

ruven commented Jul 29, 2016

OK merged! Thanks for all your efforts with this!

@stweil stweil deleted the openjpeg-work branch July 29, 2016 13:41
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

Successfully merging this pull request may close these issues.

3 participants