/[gentoo-x86]/x11-misc/winswitch/files/winswitch-0.12.18-PIL.patch
Gentoo

Contents of /x11-misc/winswitch/files/winswitch-0.12.18-PIL.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download) (as text)
Mon Jun 17 07:32:40 2013 UTC (6 years, 3 months ago) by xmw
Branch: MAIN
File MIME type: text/x-diff
distutils-r1 migration, PIL fixes (bug 471564)

(Portage version: 2.2.0_alpha180/cvs/Linux x86_64, signed Manifest commit with key 62EEF090)

1 https://bugs.gentoo.org/show_bug.cgi?id=471564
2
3 --- winswitch-0.12.18/winswitch/virt/xpra_client_util.py
4 +++ winswitch-0.12.18/winswitch/virt/xpra_client_util.py
5 @@ -95,8 +95,8 @@
6 widgets = []
7 has_pil = False
8 try:
9 - import Image
10 - has_pil = Image is not None
11 + import PIL.Image
12 + has_pil = PIL.Image is not None
13 except:
14 pass
15 jw = self.get_encoding_widget(server, server_command, options, change_cb, has_pil)
16 --- winswitch-0.12.18/winswitch/ui/capture_util.py
17 +++ winswitch-0.12.18/winswitch/ui/capture_util.py
18 @@ -125,16 +125,16 @@
19 #resize it
20 img_data = load_binary_file(self.filename)
21 import StringIO
22 - import Image
23 - image = Image.open(StringIO.StringIO(img_data))
24 + import PIL.Image
25 + image = PIL.Image.open(StringIO.StringIO(img_data))
26 self.save_resized(image)
27
28 def save_resized(self, image):
29 """ save a PIL.Image after resizing it to thumbnail size """
30 - import Image
31 + import PIL.Image
32 (w,h) = image.size
33 w,h = self.get_thumbnail_dimensions(w, h)
34 - image.thumbnail((w,h), Image.ANTIALIAS)
35 + image.thumbnail((w,h), PIL.Image.ANTIALIAS)
36 image.save(self.filename, "PNG")
37
38
39 @@ -190,13 +190,13 @@
40
41 def do_capture(self):
42 #force py2exe to include these:
43 - import Image
44 - import GifImagePlugin
45 - import JpegImagePlugin
46 - import PngImagePlugin
47 - import ImageGrab
48 - assert Image and GifImagePlugin and JpegImagePlugin and PngImagePlugin and ImageGrab #avoid pydev warnings
49 - screenshot = ImageGrab.grab()
50 + import PIL.Image
51 + import PIL.GifImagePlugin
52 + import PIL.JpegImagePlugin
53 + import PIL.PngImagePlugin
54 + import PIL.ImageGrab
55 + assert PIL.Image and PIL.GifImagePlugin and PIL.JpegImagePlugin and PIL.PngImagePlugin and PIL.ImageGrab #avoid pydev warnings
56 + screenshot = PIL.ImageGrab.grab()
57 self.save_resized(screenshot)
58 self.finish()
59
60 --- winswitch-0.12.18/winswitch/util/icon_util.py
61 +++ winswitch-0.12.18/winswitch/util/icon_util.py
62 @@ -27,7 +27,7 @@
63 HAS_CAIRO_RSVG = False
64
65 try:
66 - import Image
67 + import PIL.Image
68 has_PIL = True
69 except:
70 has_PIL = False
71 @@ -58,10 +58,10 @@
72 return scaled_data
73
74 def pil_load_scaled_pixmap(filename, size_limit):
75 - img = Image.open(filename)
76 + img = PIL.Image.open(filename)
77 (w,h) = img.size
78 if w>size_limit or h>size_limit:
79 - img.thumbnail((size_limit,size_limit), Image.ANTIALIAS)
80 + img.thumbnail((size_limit,size_limit), PIL.Image.ANTIALIAS)
81 assert img
82 return pil_image_to_png_data(img)
83

  ViewVC Help
Powered by ViewVC 1.1.20