dwgoon / jpegio

A python package for accessing the internal variables of JPEG file format such as DCT coefficients and quantization tables
Apache License 2.0
73 stars 18 forks source link

Mac version #1

Closed JakubReha closed 4 years ago

JakubReha commented 4 years ago

Hi, I am trying to compile the package on mac but I get library errors. Is there a version that works for mac? Alternatively is it possible to compile the package on linux/windows and then use on mac?

dwgoon commented 4 years ago

Could you paste the errors here? I conjecture a libjpeg part related to menory management for mac.

JakubReha commented 4 years ago

clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated] ld: library not found for -lstdc++ clang: error: linker command failed with exit code 1 (use -v to see invocation) error: command 'g++' failed with exit status 1

dwgoon commented 4 years ago

Thanks for pasting the error message here. I think I need to test the compilation on mac. I have no mac machine now. So, I will test it at my company tomorrow. Wait for a day please.

dwgoon commented 4 years ago

@JakubReha I've added and tested supports for macOS. Could you please test the JpegIO package on your machine?

JakubReha commented 4 years ago

The installation went fine, but I am getting this error when trying to import jpegio: File "/Users/kuba/Downloads/jpegio-master/jpegio/init.py", line 6, in from .componentinfo import ComponentInfo ModuleNotFoundError: No module named 'jpegio.componentinfo'

JakubReha commented 4 years ago

if I use this in the init.py: import pyximport pyximport.install()

it seems to solve the problem for the the ComponentInfo, but then I get:

/Users/kuba/anaconda3/lib/python3.7/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /Users/kuba/Downloads/jpegio-master/jpegio/decompressedjpeg.pxd tree = Parsing.p_module(s, pxd, full_module_name) Error compiling Cython file:

def __cinit__(self):
    self._jstruct_obj = NULL  # new jstruct()

def __dealloc__(self):
    if self._jstruct_obj != NULL:
        del self._jstruct_obj
       ^

jpegio/decompressedjpeg.pyx:25:12: Operation only allowed in c++

Error compiling Cython file:

cpdef read(self, fpath):
    if not self._is_valid_fpath(fpath):
        return

    if self._jstruct_obj != NULL:
        del self._jstruct_obj
       ^

jpegio/decompressedjpeg.pyx:39:12: Operation only allowed in c++

Error compiling Cython file:

        return

    if self._jstruct_obj != NULL:
        del self._jstruct_obj

    self._jstruct_obj = new jstruct()
                           ^

jpegio/decompressedjpeg.pyx:41:32: Operation only allowed in c++

dwgoon commented 4 years ago

@JakubReha From which directory did you import the JpegIO package? You should not import the package from the repository directory. If it is the case, try importing the package in another directory.

JakubReha commented 4 years ago

Thank you but now I get this: zsh: illegal hardware instruction python

dwgoon commented 4 years ago

@JakubReha How did you install JpegIO? Did you use the *.whl file or compile? Could you tell me your macOS information (version, architecture, etc)?

JakubReha commented 4 years ago

I was using the wheel, now I reinstalled it using only the compilation and it works. Thank you very much

dwgoon commented 4 years ago

@JakubReha That sounds great! :)