jbaiter / jpegtran-cffi

Fast, (mostly) lossless JPEG transformations with Python
http://jpegtran-cffi.readthedocs.org
MIT License
145 stars 23 forks source link

Do you plan to support other libjpeg? #4

Closed KBS6 closed 10 years ago

KBS6 commented 10 years ago

Gentoo, Arch and many other distribution uses default libjpeg-turbo. Attempts to install jpegtran-cffi on Gentoo cause errors.

pip install jpegtran-cffi

Downloading/unpacking jpegtran-cffi
  Downloading jpegtran-cffi-0.4.tar.gz (50kB): 50kB downloaded
  Running setup.py (path:/tmp/pip_build_root/jpegtran-cffi/setup.py) egg_info for package jpegtran-cffi
    src/transupp.c: In function ‘do_flip_h_no_crop’:
    src/transupp.c:137:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_h_scaled_size’
         (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
                                              ^
    src/transupp.c: In function ‘do_flip_h’:
    src/transupp.c:203:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_h_scaled_size’
         (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
                                              ^
    src/transupp.c: In function ‘do_flip_v’:
    src/transupp.c:268:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_v_scaled_size’
         (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);
                                              ^
    src/transupp.c: In function ‘do_rot_90’:
    src/transupp.c:396:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_h_scaled_size’
         (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
                                              ^
    src/transupp.c: In function ‘do_rot_270’:
    src/transupp.c:477:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_v_scaled_size’
         (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);
                                              ^
    src/transupp.c: In function ‘do_rot_180’:
    src/transupp.c:545:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_h_scaled_size’
         (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
                                              ^
    src/transupp.c:547:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_v_scaled_size’
         (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);
                                              ^
    src/transupp.c: In function ‘do_transverse’:
    src/transupp.c:656:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_h_scaled_size’
         (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
                                              ^
    src/transupp.c:658:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_v_scaled_size’
         (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);
                                              ^
    src/transupp.c: In function ‘jtransform_request_workspace’:
    src/transupp.c:908:11: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_h_scaled_size’
        srcinfo->min_DCT_h_scaled_size,
               ^
    src/transupp.c:909:11: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_v_scaled_size’
        srcinfo->min_DCT_v_scaled_size,
               ^
    src/transupp.c:915:40: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_h_scaled_size’
        srcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size,
                                            ^
    src/transupp.c:916:40: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_v_scaled_size’
        srcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size,
                                            ^
    src/transupp.c:935:40: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_v_scaled_size’
           info->iMCU_sample_width = srcinfo->min_DCT_v_scaled_size;
                                            ^
    src/transupp.c:936:41: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_h_scaled_size’
           info->iMCU_sample_height = srcinfo->min_DCT_h_scaled_size;
                                             ^
    src/transupp.c:939:38: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_v_scaled_size’
      srcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size;
                                          ^
    src/transupp.c:941:38: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_h_scaled_size’
      srcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size;
                                          ^
    src/transupp.c:948:40: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_h_scaled_size’
           info->iMCU_sample_width = srcinfo->min_DCT_h_scaled_size;
                                            ^
    src/transupp.c:949:41: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_v_scaled_size’
           info->iMCU_sample_height = srcinfo->min_DCT_v_scaled_size;
                                             ^
    src/transupp.c:952:38: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_h_scaled_size’
      srcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size;
                                          ^
    src/transupp.c:954:38: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_v_scaled_size’
      srcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size;
                                          ^
    src/transupp.c: In function ‘transpose_critical_parameters’:
    src/transupp.c:1127:18: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_h_scaled_size’
       itemp = dstinfo->min_DCT_h_scaled_size;
                      ^
    src/transupp.c:1128:10: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_h_scaled_size’
       dstinfo->min_DCT_h_scaled_size = dstinfo->min_DCT_v_scaled_size;
              ^
    src/transupp.c:1128:43: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_v_scaled_size’
       dstinfo->min_DCT_h_scaled_size = dstinfo->min_DCT_v_scaled_size;
                                               ^
    src/transupp.c:1129:10: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_v_scaled_size’
       dstinfo->min_DCT_v_scaled_size = itemp;
              ^
    src/transupp.c: In function ‘jtransform_adjust_parameters’:
    src/transupp.c:1365:10: error: ‘struct jpeg_compress_struct’ has no member named ‘jpeg_width’
       dstinfo->jpeg_width = info->output_width;
              ^
    src/transupp.c:1366:10: error: ‘struct jpeg_compress_struct’ has no member named ‘jpeg_height’
       dstinfo->jpeg_height = info->output_height;
              ^
    src/transupp.c:1393:16: error: ‘struct jpeg_compress_struct’ has no member named ‘jpeg_width’
         if (dstinfo->jpeg_width != srcinfo->image_width ||
                    ^
    src/transupp.c:1394:9: error: ‘struct jpeg_compress_struct’ has no member named ‘jpeg_height’
      dstinfo->jpeg_height != srcinfo->image_height)
             ^
    src/transupp.c:1398:9: error: ‘struct jpeg_compress_struct’ has no member named ‘jpeg_width’
      dstinfo->jpeg_width, dstinfo->jpeg_height);
             ^
    src/transupp.c:1398:30: error: ‘struct jpeg_compress_struct’ has no member named ‘jpeg_height’
      dstinfo->jpeg_width, dstinfo->jpeg_height);
                                  ^
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip_build_root/jpegtran-cffi/setup.py", line 4, in <module>
        import jpegtran.lib
      File "jpegtran/__init__.py", line 1, in <module>
        from jpegtran.transform import JPEGImage
      File "jpegtran/transform.py", line 3, in <module>
        import jpegtran.lib as lib
      File "jpegtran/lib.py", line 138, in <module>
        libraries=["jpeg"])
      File "/usr/lib64/python2.7/site-packages/cffi/api.py", line 339, in verify
        lib = self.verifier.load_library()
      File "/usr/lib64/python2.7/site-packages/cffi/verifier.py", line 74, in load_library
        self._compile_module()
      File "/usr/lib64/python2.7/site-packages/cffi/verifier.py", line 139, in _compile_module
        outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
      File "/usr/lib64/python2.7/site-packages/cffi/ffiplatform.py", line 25, in compile
        outputfilename = _build(tmpdir, ext)
      File "/usr/lib64/python2.7/site-packages/cffi/ffiplatform.py", line 50, in _build
        raise VerificationError('%s: %s' % (e.__class__.__name__, e))
    cffi.ffiplatform.VerificationError: CompileError: command 'x86_64-pc-linux-gnu-gcc' failed with exit status 1
    Complete output from command python setup.py egg_info:
    src/transupp.c: In function ‘do_flip_h_no_crop’:

src/transupp.c:137:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_h_scaled_size’

     (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);

                                          ^

src/transupp.c: In function ‘do_flip_h’:

src/transupp.c:203:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_h_scaled_size’

     (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);

                                          ^

src/transupp.c: In function ‘do_flip_v’:

src/transupp.c:268:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_v_scaled_size’

     (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);

                                          ^

src/transupp.c: In function ‘do_rot_90’:

src/transupp.c:396:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_h_scaled_size’

     (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);

                                          ^

src/transupp.c: In function ‘do_rot_270’:

src/transupp.c:477:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_v_scaled_size’

     (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);

                                          ^

src/transupp.c: In function ‘do_rot_180’:

src/transupp.c:545:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_h_scaled_size’

     (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);

                                          ^

src/transupp.c:547:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_v_scaled_size’

     (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);

                                          ^

src/transupp.c: In function ‘do_transverse’:

src/transupp.c:656:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_h_scaled_size’

     (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);

                                          ^

src/transupp.c:658:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_v_scaled_size’

     (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);

                                          ^

src/transupp.c: In function ‘jtransform_request_workspace’:

src/transupp.c:908:11: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_h_scaled_size’

    srcinfo->min_DCT_h_scaled_size,

           ^

src/transupp.c:909:11: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_v_scaled_size’

    srcinfo->min_DCT_v_scaled_size,

           ^

src/transupp.c:915:40: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_h_scaled_size’

    srcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size,

                                        ^

src/transupp.c:916:40: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_v_scaled_size’

    srcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size,

                                        ^

src/transupp.c:935:40: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_v_scaled_size’

       info->iMCU_sample_width = srcinfo->min_DCT_v_scaled_size;

                                        ^

src/transupp.c:936:41: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_h_scaled_size’

       info->iMCU_sample_height = srcinfo->min_DCT_h_scaled_size;

                                         ^

src/transupp.c:939:38: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_v_scaled_size’

  srcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size;

                                      ^

src/transupp.c:941:38: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_h_scaled_size’

  srcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size;

                                      ^

src/transupp.c:948:40: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_h_scaled_size’

       info->iMCU_sample_width = srcinfo->min_DCT_h_scaled_size;

                                        ^

src/transupp.c:949:41: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_v_scaled_size’

       info->iMCU_sample_height = srcinfo->min_DCT_v_scaled_size;

                                         ^

src/transupp.c:952:38: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_h_scaled_size’

  srcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size;

                                      ^

src/transupp.c:954:38: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_v_scaled_size’

  srcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size;

                                      ^

src/transupp.c: In function ‘transpose_critical_parameters’:

src/transupp.c:1127:18: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_h_scaled_size’

   itemp = dstinfo->min_DCT_h_scaled_size;

                  ^

src/transupp.c:1128:10: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_h_scaled_size’

   dstinfo->min_DCT_h_scaled_size = dstinfo->min_DCT_v_scaled_size;

          ^

src/transupp.c:1128:43: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_v_scaled_size’

   dstinfo->min_DCT_h_scaled_size = dstinfo->min_DCT_v_scaled_size;

                                           ^

src/transupp.c:1129:10: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_v_scaled_size’

   dstinfo->min_DCT_v_scaled_size = itemp;

          ^

src/transupp.c: In function ‘jtransform_adjust_parameters’:

src/transupp.c:1365:10: error: ‘struct jpeg_compress_struct’ has no member named ‘jpeg_width’

   dstinfo->jpeg_width = info->output_width;

          ^

src/transupp.c:1366:10: error: ‘struct jpeg_compress_struct’ has no member named ‘jpeg_height’

   dstinfo->jpeg_height = info->output_height;

          ^

src/transupp.c:1393:16: error: ‘struct jpeg_compress_struct’ has no member named ‘jpeg_width’

     if (dstinfo->jpeg_width != srcinfo->image_width ||

                ^

src/transupp.c:1394:9: error: ‘struct jpeg_compress_struct’ has no member named ‘jpeg_height’

  dstinfo->jpeg_height != srcinfo->image_height)

         ^

src/transupp.c:1398:9: error: ‘struct jpeg_compress_struct’ has no member named ‘jpeg_width’

  dstinfo->jpeg_width, dstinfo->jpeg_height);

         ^

src/transupp.c:1398:30: error: ‘struct jpeg_compress_struct’ has no member named ‘jpeg_height’

  dstinfo->jpeg_width, dstinfo->jpeg_height);

                              ^

Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip_build_root/jpegtran-cffi/setup.py", line 4, in <module>

    import jpegtran.lib

  File "jpegtran/__init__.py", line 1, in <module>

    from jpegtran.transform import JPEGImage

  File "jpegtran/transform.py", line 3, in <module>

    import jpegtran.lib as lib

  File "jpegtran/lib.py", line 138, in <module>

    libraries=["jpeg"])

  File "/usr/lib64/python2.7/site-packages/cffi/api.py", line 339, in verify

    lib = self.verifier.load_library()

  File "/usr/lib64/python2.7/site-packages/cffi/verifier.py", line 74, in load_library

    self._compile_module()

  File "/usr/lib64/python2.7/site-packages/cffi/verifier.py", line 139, in _compile_module

    outputfilename = ffiplatform.compile(tmpdir, self.get_extension())

  File "/usr/lib64/python2.7/site-packages/cffi/ffiplatform.py", line 25, in compile

    outputfilename = _build(tmpdir, ext)

  File "/usr/lib64/python2.7/site-packages/cffi/ffiplatform.py", line 50, in _build

    raise VerificationError('%s: %s' % (e.__class__.__name__, e))

cffi.ffiplatform.VerificationError: CompileError: command 'x86_64-pc-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/jpegtran-cffi
Traceback (most recent call last):
  File "/usr/lib/python-exec/python2.7/pip", line 9, in <module>
    load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
  File "/usr/lib64/python2.7/site-packages/pip/__init__.py", line 185, in main
    return command.main(cmd_args)
  File "/usr/lib64/python2.7/site-packages/pip/basecommand.py", line 161, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 32: ordinal not in range(128)

Or other method:

easy_install jpegtran-cffi

Searching for jpegtran-cffi
Reading https://pypi.python.org/simple/jpegtran-cffi/
Best match: jpegtran-cffi 0.4
Downloading https://pypi.python.org/packages/source/j/jpegtran-cffi/jpegtran-cffi-0.4.tar.gz#md5=daec85f5c0aed76499d78dc238ef6223
Processing jpegtran-cffi-0.4.tar.gz
Writing /tmp/easy_install-CXdhPT/jpegtran-cffi-0.4/setup.cfg
Running jpegtran-cffi-0.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-CXdhPT/jpegtran-cffi-0.4/egg-dist-tmp-POd3YG
running build_ext
building '_cffi__xf0be6f8dx8aa5264d' extension
creating /tmp/easy_install-CXdhPT/jpegtran-cffi-0.4/jpegtran/__pycache__/jpegtran
creating /tmp/easy_install-CXdhPT/jpegtran-cffi-0.4/jpegtran/__pycache__/jpegtran/__pycache__
creating /tmp/easy_install-CXdhPT/jpegtran-cffi-0.4/jpegtran/__pycache__/src
x86_64-pc-linux-gnu-gcc -pthread -fPIC -Isrc -I/usr/include/python2.7 -c jpegtran/__pycache__/_cffi__xf0be6f8dx8aa5264d.c -o /tmp/easy_install-CXdhPT/jpegtran-cffi-0.4/jpegtran/__pycache__/jpegtran/__pycache__/_cffi__xf0be6f8dx8aa5264d.o
x86_64-pc-linux-gnu-gcc -pthread -fPIC -Isrc -I/usr/include/python2.7 -c src/epeg.c -o /tmp/easy_install-CXdhPT/jpegtran-cffi-0.4/jpegtran/__pycache__/src/epeg.o
x86_64-pc-linux-gnu-gcc -pthread -fPIC -Isrc -I/usr/include/python2.7 -c src/transupp.c -o /tmp/easy_install-CXdhPT/jpegtran-cffi-0.4/jpegtran/__pycache__/src/transupp.o
src/transupp.c: In function ‘do_flip_h_no_crop’:
src/transupp.c:137:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_h_scaled_size’
     (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
                                          ^
src/transupp.c: In function ‘do_flip_h’:
src/transupp.c:203:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_h_scaled_size’
     (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
                                          ^
src/transupp.c: In function ‘do_flip_v’:
src/transupp.c:268:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_v_scaled_size’
     (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);
                                          ^
src/transupp.c: In function ‘do_rot_90’:
src/transupp.c:396:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_h_scaled_size’
     (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
                                          ^
src/transupp.c: In function ‘do_rot_270’:
src/transupp.c:477:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_v_scaled_size’
     (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);
                                          ^
src/transupp.c: In function ‘do_rot_180’:
src/transupp.c:545:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_h_scaled_size’
     (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
                                          ^
src/transupp.c:547:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_v_scaled_size’
     (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);
                                          ^
src/transupp.c: In function ‘do_transverse’:
src/transupp.c:656:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_h_scaled_size’
     (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
                                          ^
src/transupp.c:658:42: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_v_scaled_size’
     (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);
                                          ^
src/transupp.c: In function ‘jtransform_request_workspace’:
src/transupp.c:908:11: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_h_scaled_size’
    srcinfo->min_DCT_h_scaled_size,
           ^
src/transupp.c:909:11: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_v_scaled_size’
    srcinfo->min_DCT_v_scaled_size,
           ^
src/transupp.c:915:40: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_h_scaled_size’
    srcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size,
                                        ^
src/transupp.c:916:40: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_v_scaled_size’
    srcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size,
                                        ^
src/transupp.c:935:40: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_v_scaled_size’
       info->iMCU_sample_width = srcinfo->min_DCT_v_scaled_size;
                                        ^
src/transupp.c:936:41: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_h_scaled_size’
       info->iMCU_sample_height = srcinfo->min_DCT_h_scaled_size;
                                         ^
src/transupp.c:939:38: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_v_scaled_size’
  srcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size;
                                      ^
src/transupp.c:941:38: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_h_scaled_size’
  srcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size;
                                      ^
src/transupp.c:948:40: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_h_scaled_size’
       info->iMCU_sample_width = srcinfo->min_DCT_h_scaled_size;
                                        ^
src/transupp.c:949:41: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_v_scaled_size’
       info->iMCU_sample_height = srcinfo->min_DCT_v_scaled_size;
                                         ^
src/transupp.c:952:38: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_h_scaled_size’
  srcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size;
                                      ^
src/transupp.c:954:38: error: ‘struct jpeg_decompress_struct’ has no member named ‘min_DCT_v_scaled_size’
  srcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size;
                                      ^
src/transupp.c: In function ‘transpose_critical_parameters’:
src/transupp.c:1127:18: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_h_scaled_size’
   itemp = dstinfo->min_DCT_h_scaled_size;
                  ^
src/transupp.c:1128:10: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_h_scaled_size’
   dstinfo->min_DCT_h_scaled_size = dstinfo->min_DCT_v_scaled_size;
          ^
src/transupp.c:1128:43: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_v_scaled_size’
   dstinfo->min_DCT_h_scaled_size = dstinfo->min_DCT_v_scaled_size;
                                           ^
src/transupp.c:1129:10: error: ‘struct jpeg_compress_struct’ has no member named ‘min_DCT_v_scaled_size’
   dstinfo->min_DCT_v_scaled_size = itemp;
          ^
src/transupp.c: In function ‘jtransform_adjust_parameters’:
src/transupp.c:1365:10: error: ‘struct jpeg_compress_struct’ has no member named ‘jpeg_width’
   dstinfo->jpeg_width = info->output_width;
          ^
src/transupp.c:1366:10: error: ‘struct jpeg_compress_struct’ has no member named ‘jpeg_height’
   dstinfo->jpeg_height = info->output_height;
          ^
src/transupp.c:1393:16: error: ‘struct jpeg_compress_struct’ has no member named ‘jpeg_width’
     if (dstinfo->jpeg_width != srcinfo->image_width ||
                ^
src/transupp.c:1394:9: error: ‘struct jpeg_compress_struct’ has no member named ‘jpeg_height’
  dstinfo->jpeg_height != srcinfo->image_height)
         ^
src/transupp.c:1398:9: error: ‘struct jpeg_compress_struct’ has no member named ‘jpeg_width’
  dstinfo->jpeg_width, dstinfo->jpeg_height);
         ^
src/transupp.c:1398:30: error: ‘struct jpeg_compress_struct’ has no member named ‘jpeg_height’
  dstinfo->jpeg_width, dstinfo->jpeg_height);
                              ^
Traceback (most recent call last):
  File "/usr/lib/python-exec/python2.7/easy_install", line 9, in <module>
    load_entry_point('setuptools==2.2', 'console_scripts', 'easy_install')()
  File "/usr/lib64/python2.7/site-packages/setuptools/command/easy_install.py", line 1909, in main
    with_ei_usage(lambda:
  File "/usr/lib64/python2.7/site-packages/setuptools/command/easy_install.py", line 1896, in with_ei_usage
    return f()
  File "/usr/lib64/python2.7/site-packages/setuptools/command/easy_install.py", line 1913, in <lambda>
    distclass=DistributionWithoutHelpCommands, **kw
  File "/usr/lib64/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib64/python2.7/site-packages/setuptools/command/easy_install.py", line 358, in run
    self.easy_install(spec, not self.no_deps)
  File "/usr/lib64/python2.7/site-packages/setuptools/command/easy_install.py", line 593, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/usr/lib64/python2.7/site-packages/setuptools/command/easy_install.py", line 623, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/usr/lib64/python2.7/site-packages/setuptools/command/easy_install.py", line 809, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/usr/lib64/python2.7/site-packages/setuptools/command/easy_install.py", line 1015, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/usr/lib64/python2.7/site-packages/setuptools/command/easy_install.py", line 1000, in run_setup
    run_setup(setup_script, args)
  File "/usr/lib64/python2.7/site-packages/setuptools/sandbox.py", line 50, in run_setup
    lambda: execfile(
  File "/usr/lib64/python2.7/site-packages/setuptools/sandbox.py", line 100, in run
    return func()
  File "/usr/lib64/python2.7/site-packages/setuptools/sandbox.py", line 52, in <lambda>
    {'__file__':setup_script, '__name__':'__main__'}
  File "setup.py", line 4, in <module>
  File "/tmp/easy_install-CXdhPT/jpegtran-cffi-0.4/jpegtran/__init__.py", line 1, in <module>
  File "/tmp/easy_install-CXdhPT/jpegtran-cffi-0.4/jpegtran/transform.py", line 3, in <module>
  File "/tmp/easy_install-CXdhPT/jpegtran-cffi-0.4/jpegtran/lib.py", line 138, in <module>
  File "/usr/lib64/python2.7/site-packages/cffi/api.py", line 339, in verify
    lib = self.verifier.load_library()
  File "/usr/lib64/python2.7/site-packages/cffi/verifier.py", line 74, in load_library
    self._compile_module()
  File "/usr/lib64/python2.7/site-packages/cffi/verifier.py", line 139, in _compile_module
    outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
  File "/usr/lib64/python2.7/site-packages/cffi/ffiplatform.py", line 25, in compile
    outputfilename = _build(tmpdir, ext)
  File "/usr/lib64/python2.7/site-packages/cffi/ffiplatform.py", line 50, in _build
    raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.ffiplatform.VerificationError: CompileError: command 'x86_64-pc-linux-gnu-gcc' failed with exit status 1
jbaiter commented 10 years ago

Hm, that would be great for sure... From looking at the turbojpeg.h, they have their own slightly different API for lossless transformations: https://github.com/leapmotion/libjpeg-turbo/blob/master/turbojpeg.h#L904 And admittedly, it looks a lot nicer than the libjpeg8 API :smiley: I'll look into it, either I switch from using libjpeg8 to libjpeg-turbo (seems to be included in most distributions) or I offer it as a fallback through its own lib-turbo.py backend.

KBS6 commented 10 years ago

That this project and turbo jpeg.h API. The difference is that the libjpeg-turbo only displaces libjpeg8, but many old programs and libraries using the version 8d. I think the lib-turbo.py backend is a good idea to get as much distribution served by new and old API in your project.

jbaiter commented 10 years ago

I commited some changes last night that should make the package work with libjpeg-turbo as well! Just make sure you have the turbojpeg.h headers on your system and it should work as is.