이것은 Mountain Lion (OSX 10.8.3)에 있습니다. 그래서 필요한 라이브러리를 다운로드, 빌드 및 설치했습니다. 나는 성공적으로 sudo python setup.py install
를 실행 이후 ...JPEG 지원을 찾기 위해 Python 이미징 라이브러리를 가져올 수 없습니다.
TCL_ROOT = libinclude("/usr")
JPEG_ROOT = libinclude("/usr/local")
ZLIB_ROOT = libinclude("/usr")
FREETYPE_ROOT = libinclude("/usr/local")
LCMS_ROOT = libinclude("/usr/local")
그리고 실행 setup.py가 작동하는 것 같다 ...
airguitar:Imaging-1.1.7 chuck 597$ python setup.py build_ext -i
running build_ext
--- using frameworks at /System/Library/Frameworks
--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version 1.1.7
platform darwin 2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)]
--------------------------------------------------------------------
--- TKINTER support available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support available
--- LITTLECMS support available
--------------------------------------------------------------------
To check the build, run the selftest.py script.
을 적절한 장소를 참조 할 setup.py 수정했습니다. 내가 얻는자가 테스트 ...
airguitar:Imaging-1.1.7 chuck 600$ python selftest.py
--------------------------------------------------------------------
PIL 1.1.7 TEST SUMMARY
--------------------------------------------------------------------
Python modules loaded from ./PIL
Binary modules loaded from ./PIL
--------------------------------------------------------------------
--- PIL CORE support ok
--- TKINTER support ok
*** JPEG support not installed
--- ZLIB (PNG/ZIP) support ok
--- FREETYPE2 support ok
--- LITTLECMS support ok
--------------------------------------------------------------------
Running selftest:
*****************************************************************
Failure in example:
try:
_info(Image.open(os.path.join(ROOT, "Images/lena.jpg")))
except IOError, v:
print v
from line #24 of selftest.testimage
Expected: ('JPEG', 'RGB', (128, 128))
Got: decoder jpeg not available
1 items had failures:
1 of 57 in selftest.testimage
***Test Failed*** 1 failures.
*** 1 tests of 57 failed.
주를 실행할 때 자체 테스트 내가 JPEG 지원이 설치되지 않은 주장 것이다.
제안 사항?
업데이트 : 그것은
나는 아마도 문제는 내가 알기 전에 내가, 내가 설치 프로그램을 실행했던 내 자신 JPEG 및 기타 라이브러리를 구축했다는 것을 것을 의심 ... 악화된다. 그래서 깨끗한 PIL 배포로 다시 시작하려고했습니다. 내가 python setup.py build
를 실행할 때 지금은 결국
clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DHAVE_LIBJPEG -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/usr/local/include/freetype2 -IlibImaging -I/System/Library/Frameworks/Python.framework/Versions/2.7/include -I/usr/include -I/usr/local/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c libImaging/JpegDecode.c -o build/temp.macosx-10.8-intel-2.7/libImaging/JpegDecode.o
clang: warning: argument unused during compilation: '-mno-fused-madd'
libImaging/JpegDecode.c:118:1: error: conflicting types for 'ImagingJpegDecode'
ImagingJpegDecode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes)
^
libImaging/Imaging.h:415:12: note: previous declaration is here
extern int ImagingJpegDecode(Imaging im, ImagingCodecState state,
^
libImaging/JpegDecode.c:145:41: warning: incompatible pointer types assigning to
'const JOCTET *' (aka 'const char *') from 'UINT8 *' (aka 'short *')
[-Wincompatible-pointer-types]
context->source.pub.next_input_byte = buf;
^~~~
libImaging/JpegDecode.c:151:49: error: 'const JOCTET *' (aka 'const char *') and
'UINT8 *' (aka 'short *') are not pointers to compatible types
return context->source.pub.next_input_byte - buf;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
libImaging/JpegDecode.c:235:21: warning: incompatible pointer types passing
'UINT8 *' (aka 'short *') to parameter of type 'unsigned char *'
[-Wincompatible-pointer-types]
state->shuffle((UINT8*) im->image[state->y + state->yoff] +
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libImaging/JpegDecode.c:262:48: error: 'const JOCTET *' (aka 'const char *') and
'UINT8 *' (aka 'short *') are not pointers to compatible types
return context->source.pub.next_input_byte - buf;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
2 warnings and 3 errors generated.
error: command 'clang' failed with exit status 1
나는 '옳은 일'을 할이를 구성하는 방법에 대해 아무 생각이 ... 얻을. 도움을 주시면 감사하겠습니다.
감사에서,이 일을 설치합니다. 하지만 먼저 python setup.py clean을 실행해야했습니다. 언젠가 시간이있을 때 나는 세부 사항을 파고들 것이다. 지금 당장은 모든 것이 효과가 있다는 것에 놀랐습니다. 고마워, 또. – Chuck