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

OpenJpeg 2.1 #681

Merged
merged 8 commits into from
Jun 22, 2014
Merged

OpenJpeg 2.1 #681

merged 8 commits into from
Jun 22, 2014

Conversation

wiredfool
Copy link
Member

Includes #675.

  • Fixes build failure when openjpeg is not installed.
  • Updates version of openjpeg installed for travis.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.06%) when pulling bc2c7be on wiredfool:openjpeg_21 into 6bb3b15 on python-imaging:master.

@wiredfool
Copy link
Member Author

Still failing on PPC

@aclark4life
Copy link
Member

Should I manually merge this?

@aclark4life aclark4life added this to the 2.5.0 milestone Jun 7, 2014
@wiredfool
Copy link
Member Author

I wanted to check on windows, but I'm having trouble getting Pillow to build with any of the any of the openjpegs there.

@aclark4life
Copy link
Member

@wiredfool Maybe @cgohlke can help

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.54%) when pulling da1523d on wiredfool:openjpeg_21 into 841582f on python-pillow:master.

@wiredfool
Copy link
Member Author

This has been merged to pre-unittest conversion. I'd still like to get some successful testing done on windows.

@wiredfool
Copy link
Member Author

Did battle a bit more with windows, and I can't get it to link with openjpeg at all, either compiling the lib or using the prebuilt binaries, zip file or installer.

@cgohlke
Copy link
Contributor

cgohlke commented Jun 11, 2014

I just tried wiredfool:openjpeg_21 on win-amd64-py3.4 with openjpeg 2.1 from svn trunk. It builds fine and the test failures seem unrelated.

--------------------------------------------------------------------
Pillow 2.4.0 TEST SUMMARY
--------------------------------------------------------------------
Python modules loaded from D:\Build\Pillow\Pillow-openjpeg_21\PIL
Binary modules loaded from D:\Build\Pillow\Pillow-openjpeg_21\PIL
--------------------------------------------------------------------
--- PIL CORE support ok
--- TKINTER support ok
--- JPEG support ok
--- JPEG 2000 support ok
--- ZLIB (PNG/ZIP) support ok
--- LIBTIFF support ok
--- FREETYPE2 support ok
--- LITTLECMS2 support ok
--- WEBP support ok
--- Transparent WEBP support ok
--------------------------------------------------------------------
Running selftest:
--- 57 tests passed.
Press any key to continue . . .
--------------------------------------------------------------------
running test_000_sanity ...
running test_001_archive ...
running test_bmp_reference ...
running test_cffi ...
running test_file_bmp ...
running test_file_eps ...
running test_file_fli ...
running test_file_gif ...
running test_file_icns ...
running test_file_ico ...
running test_file_jpeg ...
running test_file_jpeg2k ...
running test_file_libtiff ...
running test_file_libtiff_small ...
running test_file_msp ...
running test_file_pcx ...
running test_file_pdf ...
running test_file_png ...
running test_file_ppm ...
running test_file_psd ...
running test_file_spider ...
running test_file_tar ...
running test_file_tiff ...
running test_file_tiff_metadata ...
running test_file_webp ...
running test_file_webp_alpha ...
running test_file_webp_lossless ...
running test_file_webp_metadata ...
running test_file_xbm ...
running test_file_xpm ...
running test_font_bdf ...
running test_font_pcf ...
running test_format_lab ...
running test_image ...
running test_image_array ...
running test_image_convert ...
running test_image_copy ...
running test_image_crop ...
running test_image_draft ...
running test_image_filter ...
running test_image_frombytes ...
running test_image_getbands ...
running test_image_getbbox ...
running test_image_getcolors ...
running test_image_getdata ...
running test_image_getextrema ...
running test_image_getim ...
running test_image_getpalette ...
running test_image_getpixel ...
running test_image_getprojection ...
running test_image_histogram ...
running test_image_load ...
running test_image_mode ...
running test_image_offset ...
running test_image_paste ...
running test_image_point ...
running test_image_putalpha ...
running test_image_putdata ...
running test_image_putpalette ...
running test_image_putpixel ...
running test_image_quantize ...
running test_image_resize ...
running test_image_rotate ...
running test_image_save ...
running test_image_seek ...
running test_image_show ...
running test_image_split ...
running test_image_tell ...
running test_image_thumbnail ...
running test_image_tobitmap ...
running test_image_tobytes ...
running test_image_transform ...
running test_image_transpose ...
running test_image_verify ...
running test_imagechops ...
running test_imagecms ...
running test_imagecolor ...
running test_imagedraw ...
Tests\test_imagedraw.py:61: assert_image_equal(im, Image.open("Tests/images/imagedraw_arc.png")) failed:
- got different content
Tests\test_imagedraw.py:61: assert_image_equal(im, Image.open("Tests/images/imagedraw_arc.png")) failed:
- got different content
Tests\test_imagedraw.py:96: assert_image_equal(im, Image.open("Tests/images/imagedraw_chord.png")) failed:
- got different content
Tests\test_imagedraw.py:96: assert_image_equal(im, Image.open("Tests/images/imagedraw_chord.png")) failed:
- got different content
Tests\test_imagedraw.py:117: assert_image_equal(im, Image.open("Tests/images/imagedraw_ellipse.png")) failed:
- got different content
Tests\test_imagedraw.py:117: assert_image_equal(im, Image.open("Tests/images/imagedraw_ellipse.png")) failed:
- got different content
Tests\test_imagedraw.py:159: assert_image_equal(im, Image.open("Tests/images/imagedraw_pieslice.png")) failed:
- got different content
Tests\test_imagedraw.py:159: assert_image_equal(im, Image.open("Tests/images/imagedraw_pieslice.png")) failed:
- got different content
running test_imageenhance ...
running test_imagefile ...
running test_imagefileio ...
running test_imagefilter ...
running test_imagefont ...
running test_imagegrab ...
running test_imagemath ...
running test_imagemode ...
running test_imageops ...
running test_imageops_usm ...
running test_imagepalette ...
running test_imagepath ...
running test_imageqt ...
running test_imagesequence ...
running test_imageshow ...
running test_imagestat ...
running test_imagetk ...
running test_imagetransform ...
running test_imagewin ...
running test_lib_image ...
running test_lib_pack ...
running test_locale ...
running test_mode_i16 ...
running test_numpy ...
running test_olefileio ...
running test_pickle ...
--------------------------------------------------------------------
=== remaining temporary files
C:\Users\gohlke\AppData\Local\Temp\pillow-tests\temp_file_libtiff_10.tif
C:\Users\gohlke\AppData\Local\Temp\pillow-tests\temp_file_libtiff_6.tiff
C:\Users\gohlke\AppData\Local\Temp\pillow-tests\temp_file_webp_1.webp
C:\Users\gohlke\AppData\Local\Temp\pillow-tests\temp_file_webp_2.webp
--------------------------------------------------------------------
*** 1 test of 104 failed:
test_imagedraw

As usual I do override all the PIL feature detection and hard code it for my build environment in setup.py:

        # core library
        feature.zlib = "zlib"
        feature.jpeg = "jpeg"
        feature.jpeg2000 = "openjp2"
        feature.openjpeg_version = '2.1'
        feature.tiff = "tiff"
        feature.webp = "webp"
        feature.webpmux = "webpmux"
        feature.lcms = "lcms"
        feature.freetype = "freetype"
        feature.freetype_version = 24
        if not '__pypy__' in sys.builtin_module_names:
            if sys.version_info < (3, 4):
                feature.tcl = "tcl85"
                feature.tk = "tk85"
            else:
                feature.tcl = "tcl86t"
                feature.tk = "tk86t"

All libraries are static. The headers and libraries can be found in %INCLUDE% and %LIB% (or %INCLIB% on my system).

I build openjpeg with cmake:

call cmake.cmd -G"Visual Studio 10 Win64" -H%SOURCEDIR% -B%BUILDDIR%  ^
    -DBUILD_SHARED_LIBS=OFF  ^
    -DZLIB_INCLUDE_DIR=%INCLIB% ^
    -DZLIB_LIBRARY=%INCLIB%/zlib.lib ^
    -DTIFF_INCLUDE_DIR=%INCLIB% ^
    -DTIFF_LIBRARY=%INCLIB%/tiff.lib ^
    -DPNG_PNG_INCLUDE_DIR=%INCLIB% ^
    -DPNG_LIBRARY=%INCLIB%/png.lib ^
    -DLCMS2_INCLUDE_DIR=%INCLIB% ^
    -DLCMS2_LIBRARY=%INCLIB%/lcms2_static.lib ^
    %CMAKEOPT%

call devenv.exe OPENJPEG.sln /build "Release|x64"

@wiredfool
Copy link
Member Author

@cgohlke: My problem is more that I'm not at a stable working windows build yet than this patch.

With your confirmation and what I've tested locally, I think this one is good to merge.

aclark4life added a commit that referenced this pull request Jun 22, 2014
@aclark4life aclark4life merged commit a126844 into python-pillow:master Jun 22, 2014
@aclark4life
Copy link
Member

Thanks @cgohlke and @wiredfool

@wiredfool wiredfool deleted the openjpeg_21 branch September 23, 2014 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants