Merge commit '8b2e7ee48ac9317b79bb7f0053a9201ada8d7d08' into fix-issue-857

This commit is contained in:
etienne 2014-09-02 14:50:01 -04:00
commit 2b844e7872
9 changed files with 35 additions and 22 deletions

View File

@ -4,6 +4,9 @@ Changelog (Pillow)
2.6.0 (unreleased)
------------------
- Windows fixes #871
[wiredfool]
- Fix TGA files with image ID field #856
[megabuz]

View File

@ -10,6 +10,9 @@ Install::
pip install coverage nose
If you're using Python 2.6, there's one additional dependency::
pip install unittest2
Execution
---------

View File

@ -4,8 +4,7 @@ import os
from PIL import Image, TiffImagePlugin
class TestFileLibTiff(PillowTestCase):
class LibTiffTestCase(PillowTestCase):
def setUp(self):
codecs = dir(Image.core)
@ -32,6 +31,8 @@ class TestFileLibTiff(PillowTestCase):
out = self.tempfile("temp.png")
im.save(out)
class TestFileLibTiff(LibTiffTestCase):
def test_g4_tiff(self):
"""Test the ordinary file path load path"""

View File

@ -2,12 +2,10 @@ from helper import unittest
from PIL import Image
from test_file_libtiff import TestFileLibTiff
from test_file_libtiff import LibTiffTestCase
class TestFileLibTiffSmall(TestFileLibTiff):
# Inherits TestFileLibTiff's setUp() and self._assert_noerr()
class TestFileLibTiffSmall(LibTiffTestCase):
""" The small lena image was failing on open in the libtiff
decoder because the file pointer was set to the wrong place

View File

@ -11,9 +11,9 @@ rm -r openjpeg-2.1.0
tar -xvzf openjpeg-2.1.0.tar.gz
pushd openjpeg-2.1.0
pushd openjpeg-2.1.0
cmake -DCMAKE_INSTALL_PREFIX=/usr . && make && sudo make install
cmake -DCMAKE_INSTALL_PREFIX=/usr . && make -j4 && sudo make -j4 install
popd

View File

@ -1,18 +1,15 @@
#!/bin/bash
# install webp
if [ ! -f libwebp-0.4.0.tar.gz ]; then
wget 'https://webp.googlecode.com/files/libwebp-0.4.0.tar.gz'
if [ ! -f libwebp-0.4.1.tar.gz ]; then
wget 'http://downloads.webmproject.org/releases/webp/libwebp-0.4.1.tar.gz'
fi
rm -r libwebp-0.4.0
tar -xvzf libwebp-0.4.0.tar.gz
rm -r libwebp-0.4.1
tar -xvzf libwebp-0.4.1.tar.gz
pushd libwebp-0.4.1
pushd libwebp-0.4.0
./configure --prefix=/usr --enable-libwebpmux --enable-libwebpdemux && make && sudo make install
./configure --prefix=/usr --enable-libwebpmux --enable-libwebpdemux && make -j4 && sudo make -j4 install
popd

View File

@ -49,6 +49,12 @@
#define L(rgb)\
((INT32) (rgb)[0]*299 + (INT32) (rgb)[1]*587 + (INT32) (rgb)[2]*114)
#ifndef round
double round(double x) {
return floor(x+0.5);
}
#endif
/* ------------------- */
/* 1 (bit) conversions */
/* ------------------- */

View File

@ -3,7 +3,7 @@
from multiprocessing import Pool, cpu_count
from distutils.ccompiler import CCompiler
import os
import os, sys
try:
MAX_PROCS = int(os.environ.get('MAX_CONCURRENCY', cpu_count()))
@ -50,7 +50,7 @@ def _mp_compile(self, sources, output_dir=None, macros=None,
return objects
# explicitly don't enable if environment says 1 processor
if MAX_PROCS != 1:
if MAX_PROCS != 1 and not sys.platform.startswith('win'):
try:
# bug, only enable if we can make a Pool. see issue #790 and
# http://stackoverflow.com/questions/6033599/oserror-38-errno-38-with-multiprocessing

View File

@ -487,6 +487,8 @@ class pil_build_ext(build_ext):
# In Google's precompiled zip it is call "libwebp":
if _find_library_file(self, "webp"):
feature.webp = "webp"
elif _find_library_file(self, "libwebp"):
feature.webp = "libwebp"
if feature.want('webpmux'):
if (_find_include_file(self, "webp/mux.h") and
@ -494,6 +496,9 @@ class pil_build_ext(build_ext):
if (_find_library_file(self, "webpmux") and
_find_library_file(self, "webpdemux")):
feature.webpmux = "webpmux"
if (_find_library_file(self, "libwebpmux") and
_find_library_file(self, "libwebpdemux")):
feature.webpmux = "libwebpmux"
for f in feature:
if not getattr(feature, f) and feature.require(f):
@ -559,13 +564,13 @@ class pil_build_ext(build_ext):
libraries=["lcms2"] + extra))
if os.path.isfile("_webp.c") and feature.webp:
libs = ["webp"]
libs = [feature.webp]
defs = []
if feature.webpmux:
defs.append(("HAVE_WEBPMUX", None))
libs.append("webpmux")
libs.append("webpdemux")
libs.append(feature.webpmux)
libs.append(feature.webpmux.replace('pmux','pdemux'))
exts.append(Extension(
"PIL._webp", ["_webp.c"], libraries=libs, define_macros=defs))