File pillow.patch of Package fretsonfire
diff -Nur fretsonfire-1.3.110/src/Font.py new/src/Font.py
--- fretsonfire-1.3.110/src/Font.py 2021-04-02 01:06:05.282528660 +0200
+++ new/src/Font.py 2021-04-02 01:03:29.489134693 +0200
@@ -174,7 +174,8 @@
"""
# Draw outlines
- import Image, ImageFilter
+ from PIL import Image
+ import ImageFilter
srcImg = Image.fromstring("RGBA", s.get_size(), pygame.image.tostring(s, "RGBA"))
img = Image.fromstring("RGBA", s.get_size(), pygame.image.tostring(s, "RGBA"))
for y in xrange(img.size[1]):
diff -Nur fretsonfire-1.3.110/src/Texture.py new/src/Texture.py
--- fretsonfire-1.3.110/src/Texture.py 2008-09-07 13:35:12.000000000 +0200
+++ new/src/Texture.py 2021-04-02 01:12:39.218053427 +0200
@@ -24,10 +24,10 @@
import Log
import Config
-import Image
+from PIL import Image
import pygame
import StringIO
-import PngImagePlugin
+from PIL import PngImagePlugin
from OpenGL.GL import *
from OpenGL.GLU import *
from Queue import Queue, Empty
@@ -210,13 +210,13 @@
"""Load the texture from a PIL image"""
image = image.transpose(Image.FLIP_TOP_BOTTOM)
if image.mode == "RGBA":
- string = image.tostring('raw', 'RGBA', 0, -1)
+ string = image.tobytes('raw', 'RGBA', 0, -1)
self.loadRaw(image.size, string, GL_RGBA, 4)
elif image.mode == "RGB":
- string = image.tostring('raw', 'RGB', 0, -1)
+ string = image.tobytes('raw', 'RGB', 0, -1)
self.loadRaw(image.size, string, GL_RGB, 3)
elif image.mode == "L":
- string = image.tostring('raw', 'L', 0, -1)
+ string = image.tobytes('raw', 'L', 0, -1)
self.loadRaw(image.size, string, GL_LUMINANCE, 1)
else:
raise TextureException("Unsupported image mode '%s'" % image.mode)
@@ -256,7 +256,7 @@
# appears to be using PIL to do the conversion.
string = pygame.image.tostring(surface, "RGB")
image = Image.fromstring("RGB", surface.get_size(), string).convert("L")
- string = image.tostring('raw', 'L', 0, -1)
+ string = image.tobytes('raw', 'L', 0, -1)
self.loadRaw(surface.get_size(), string, GL_LUMINANCE, GL_INTENSITY8)
else:
if alphaChannel: