mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-18 03:04:45 +03:00
Merge branch 'master' into relative
This commit is contained in:
commit
4555538d1a
|
@ -14,7 +14,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
# mode descriptor cache
|
# mode descriptor cache
|
||||||
_modes = {}
|
_modes = None
|
||||||
|
|
||||||
|
|
||||||
class ModeDescriptor(object):
|
class ModeDescriptor(object):
|
||||||
|
@ -32,19 +32,24 @@ class ModeDescriptor(object):
|
||||||
|
|
||||||
def getmode(mode):
|
def getmode(mode):
|
||||||
"""Gets a mode descriptor for the given mode."""
|
"""Gets a mode descriptor for the given mode."""
|
||||||
|
global _modes
|
||||||
if not _modes:
|
if not _modes:
|
||||||
# initialize mode cache
|
# initialize mode cache
|
||||||
|
|
||||||
from . import Image
|
from . import Image
|
||||||
|
modes = {}
|
||||||
# core modes
|
# core modes
|
||||||
for m, (basemode, basetype, bands) in Image._MODEINFO.items():
|
for m, (basemode, basetype, bands) in Image._MODEINFO.items():
|
||||||
_modes[m] = ModeDescriptor(m, bands, basemode, basetype)
|
modes[m] = ModeDescriptor(m, bands, basemode, basetype)
|
||||||
# extra experimental modes
|
# extra experimental modes
|
||||||
_modes["RGBa"] = ModeDescriptor("RGBa", ("R", "G", "B", "a"), "RGB", "L")
|
modes["RGBa"] = ModeDescriptor("RGBa", ("R", "G", "B", "a"), "RGB", "L")
|
||||||
_modes["LA"] = ModeDescriptor("LA", ("L", "A"), "L", "L")
|
modes["LA"] = ModeDescriptor("LA", ("L", "A"), "L", "L")
|
||||||
_modes["La"] = ModeDescriptor("La", ("L", "a"), "L", "L")
|
modes["La"] = ModeDescriptor("La", ("L", "a"), "L", "L")
|
||||||
_modes["PA"] = ModeDescriptor("PA", ("P", "A"), "RGB", "L")
|
modes["PA"] = ModeDescriptor("PA", ("P", "A"), "RGB", "L")
|
||||||
# mapping modes
|
# mapping modes
|
||||||
_modes["I;16"] = ModeDescriptor("I;16", "I", "L", "L")
|
modes["I;16"] = ModeDescriptor("I;16", "I", "L", "L")
|
||||||
_modes["I;16L"] = ModeDescriptor("I;16L", "I", "L", "L")
|
modes["I;16L"] = ModeDescriptor("I;16L", "I", "L", "L")
|
||||||
_modes["I;16B"] = ModeDescriptor("I;16B", "I", "L", "L")
|
modes["I;16B"] = ModeDescriptor("I;16B", "I", "L", "L")
|
||||||
|
# set global mode cache atomically
|
||||||
|
_modes = modes
|
||||||
return _modes[mode]
|
return _modes[mode]
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# install libimagequant
|
# install libimagequant
|
||||||
|
|
||||||
archive=pngquant-2.8.2
|
archive=libimagequant-2.8.2
|
||||||
|
|
||||||
./download-and-extract.sh $archive https://raw.githubusercontent.com/python-pillow/pillow-depends/master/$archive.tar.gz
|
./download-and-extract.sh $archive https://raw.githubusercontent.com/python-pillow/pillow-depends/master/$archive.tar.gz
|
||||||
|
|
||||||
pushd $archive
|
pushd $archive
|
||||||
|
|
||||||
make -C lib shared
|
make shared
|
||||||
sudo cp lib/libimagequant.so* /usr/lib/
|
sudo cp libimagequant.so* /usr/lib/
|
||||||
sudo cp lib/libimagequant.h /usr/include/
|
sudo cp libimagequant.h /usr/include/
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
|
@ -16,7 +16,7 @@ def setup_vms():
|
||||||
for arch in ('', X64_EXT):
|
for arch in ('', X64_EXT):
|
||||||
ret.append("virtualenv -p c:/Python%s%s/python.exe --clear %s%s%s"
|
ret.append("virtualenv -p c:/Python%s%s/python.exe --clear %s%s%s"
|
||||||
% (py, arch, VIRT_BASE, py, arch))
|
% (py, arch, VIRT_BASE, py, arch))
|
||||||
ret.append("%s%s%s\Scripts\pip.exe install nose" %
|
ret.append(r"%s%s%s\Scripts\pip.exe install nose" %
|
||||||
(VIRT_BASE, py, arch))
|
(VIRT_BASE, py, arch))
|
||||||
return "\n".join(ret)
|
return "\n".join(ret)
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ def _relpath(*args):
|
||||||
def _relbuild(*args):
|
def _relbuild(*args):
|
||||||
return _relpath('build', *args)
|
return _relpath('build', *args)
|
||||||
|
|
||||||
|
|
||||||
build_dir = _relpath('build')
|
build_dir = _relpath('build')
|
||||||
inc_dir = _relpath('depends')
|
inc_dir = _relpath('depends')
|
||||||
|
|
||||||
|
@ -108,7 +109,7 @@ set MSBUILD=C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe
|
||||||
set CMAKE="cmake.exe"
|
set CMAKE="cmake.exe"
|
||||||
set INCLIB=%~dp0\depends
|
set INCLIB=%~dp0\depends
|
||||||
set BUILD=%~dp0\build
|
set BUILD=%~dp0\build
|
||||||
""" + "\n".join('set %s=%%BUILD%%\%s' % (k.upper(), v['dir'])
|
""" + "\n".join(r'set %s=%%BUILD%%\%s' % (k.upper(), v['dir'])
|
||||||
for (k, v) in libs.items() if v['dir'])
|
for (k, v) in libs.items() if v['dir'])
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,10 +19,10 @@ libs = {
|
||||||
# 'version': '2.0'
|
# 'version': '2.0'
|
||||||
# },
|
# },
|
||||||
'zlib': {
|
'zlib': {
|
||||||
'url': 'http://zlib.net/zlib128.zip',
|
'url': 'http://zlib.net/zlib1210.zip',
|
||||||
'filename': PILLOW_DEPENDS_DIR + 'zlib128.zip',
|
'filename': PILLOW_DEPENDS_DIR + 'zlib1210.zip',
|
||||||
'hash': 'md5:126f8676442ffbd97884eb4d6f32afb4',
|
'hash': 'md5:5327bdff96926cf9c479008bae983bc0',
|
||||||
'dir': 'zlib-1.2.8',
|
'dir': 'zlib-1.2.10',
|
||||||
},
|
},
|
||||||
'jpeg': {
|
'jpeg': {
|
||||||
'url': 'http://www.ijg.org/files/jpegsr9b.zip',
|
'url': 'http://www.ijg.org/files/jpegsr9b.zip',
|
||||||
|
@ -37,10 +37,10 @@ libs = {
|
||||||
'dir': 'tiff-4.0.6',
|
'dir': 'tiff-4.0.6',
|
||||||
},
|
},
|
||||||
'freetype': {
|
'freetype': {
|
||||||
'url': 'http://download.savannah.gnu.org/releases/freetype/freetype-2.7.tar.gz',
|
'url': 'http://download.savannah.gnu.org/releases/freetype/freetype-2.7.1.tar.gz',
|
||||||
'filename': PILLOW_DEPENDS_DIR + 'freetype-2.7.tar.gz',
|
'filename': PILLOW_DEPENDS_DIR + 'freetype-2.7.1.tar.gz',
|
||||||
'hash': 'md5:337139e5c7c5bd645fe130608e0fa8b5',
|
'hash': 'md5:78701bee8d249578d83bb9a2f3aa3616',
|
||||||
'dir': 'freetype-2.7',
|
'dir': 'freetype-2.7.1',
|
||||||
},
|
},
|
||||||
'lcms': {
|
'lcms': {
|
||||||
'url': SF_MIRROR+'/project/lcms/lcms/2.7/lcms2-2.7.zip',
|
'url': SF_MIRROR+'/project/lcms/lcms/2.7/lcms2-2.7.zip',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user