[dev-python/imaging] port from tree, add proper python-tk dependency

This commit is contained in:
Fabio Erculiani
2013-08-06 16:02:04 +02:00
parent a94c080e7d
commit d74dc6069f
7 changed files with 174 additions and 0 deletions
@@ -0,0 +1,14 @@
--- Imaging-1.1.6.orig/PIL/GifImagePlugin.py 2006-12-03 11:37:15.000000000 +0000
+++ Imaging-1.1.6/PIL/GifImagePlugin.py 2008-10-02 14:51:43.000000000 +0100
@@ -352,6 +352,11 @@
for i in range(maxcolor):
s.append(chr(i) * 3)
+ if im.info.has_key('transparency'):
+ transparentIndex = im.info['transparency']
+ s.append('!' + chr(0xf9) + chr(4) + chr(1) + chr(0) + chr(0) +
+ chr(transparentIndex) + chr(0))
+
return s
def getdata(im, offset = (0, 0), **params):
@@ -0,0 +1,20 @@
--- setup.py.old 2009-07-03 11:34:59.141671252 +0200
+++ setup.py 2009-07-03 11:51:54.415666711 +0200
@@ -281,6 +281,8 @@ class pil_build_ext(build_ext):
if struct.unpack("h", "\0\1")[0] == 1:
defs.append(("WORDS_BIGENDIAN", None))
+ libs.append("m")
+
exts = [(Extension(
"_imaging", files, libraries=libs, define_macros=defs
))]
@@ -332,7 +334,7 @@ class pil_build_ext(build_ext):
))
if os.path.isfile("_imagingmath.c"):
- exts.append(Extension("_imagingmath", ["_imagingmath.c"]))
+ exts.append(Extension("_imagingmath", ["_imagingmath.c"], libraries=["m"]))
self.extensions[:] = exts
@@ -0,0 +1,18 @@
--- PIL/ImageShow.py.old 2009-11-30 10:28:37.000000000 +0100
+++ PIL/ImageShow.py 2009-11-30 10:29:02.000000000 +0100
@@ -149,13 +149,10 @@
def get_command_ex(self, file, title=None, **options):
# note: xv is pretty outdated. most modern systems have
# imagemagick's display command instead.
- command = executable = "xv"
- if title:
- # FIXME: do full escaping
- command = command + " -name \"%s\"" % title
+ command = executable = "xdg-open"
return command, executable
- if which("xv"):
+ if which("xdg-open"):
register(XVViewer)
if __name__ == "__main__":
@@ -0,0 +1,13 @@
--- Imaging-1.1.6/Sane/_sane.c.orig 2006-12-03 13:12:22.000000000 +0100
+++ Imaging-1.1.6/Sane/_sane.c 2009-02-28 11:41:19.000000000 +0200
@@ -1152,8 +1152,8 @@
static PyObject *
PySane_get_devices(PyObject *self, PyObject *args)
{
- SANE_Device **devlist;
- SANE_Device *dev;
+ const SANE_Device **devlist;
+ const SANE_Device *dev;
SANE_Status st;
PyObject *list;
int local_only, i;