aboutsummaryrefslogtreecommitdiff
path: root/audio/decibel-audio-player/covers-pil.patch
diff options
context:
space:
mode:
authorEdinaldo P. Silva <edps.mundognu@gmail.com>2015-05-28 19:36:54 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2015-05-31 10:36:18 +0700
commitbde21007fba80e04c250391056248ff37cf8afd0 (patch)
tree7c631f960a3443455fe70167ea8a47362fdcf56f /audio/decibel-audio-player/covers-pil.patch
parent6e212a2445deee3caf69add8c068b0e3b0840636 (diff)
downloadslackbuilds-bde21007fba80e04c250391056248ff37cf8afd0.tar.xz
audio/decibel-audio-player: Added (GTK+ audio player for GNU/Linux).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'audio/decibel-audio-player/covers-pil.patch')
-rw-r--r--audio/decibel-audio-player/covers-pil.patch100
1 files changed, 100 insertions, 0 deletions
diff --git a/audio/decibel-audio-player/covers-pil.patch b/audio/decibel-audio-player/covers-pil.patch
new file mode 100644
index 000000000000..baf22357ffed
--- /dev/null
+++ b/audio/decibel-audio-player/covers-pil.patch
@@ -0,0 +1,100 @@
+diff -crB src/decibel-audio-player-1.08/src/modules/Covers.py src_patched/decibel-audio-player-1.08/src/modules/Covers.py
+*** src/decibel-audio-player-1.08/src/modules/Covers.py 2011-09-19 12:09:25.000000000 +0200
+--- src_patched/decibel-audio-player-1.08/src/modules/Covers.py 2014-10-19 05:43:49.575245931 +0200
+***************
+*** 124,140 ****
+
+ def generateFullSizeCover(self, inFile, outFile, format):
+ """ Resize inFile if needed, and write it to outFile (outFile and inFile may be equal) """
+! import Image
+
+ try:
+ # Open the image
+! cover = Image.open(inFile)
+
+ # Fit the image into FULLSIZE_WIDTH x FULLSIZE_HEIGHT
+ (newWidth, newHeight) = self.__resizeWithRatio(cover.size[PIL_WIDTH], cover.size[PIL_HEIGHT], FULLSIZE_WIDTH, FULLSIZE_HEIGHT)
+
+ # Resize it
+! cover = cover.resize((newWidth, newHeight), Image.ANTIALIAS)
+
+ # We're done
+ cover.save(outFile, format)
+--- 124,140 ----
+
+ def generateFullSizeCover(self, inFile, outFile, format):
+ """ Resize inFile if needed, and write it to outFile (outFile and inFile may be equal) """
+! import PIL.Image
+
+ try:
+ # Open the image
+! cover = PIL.Image.open(inFile)
+
+ # Fit the image into FULLSIZE_WIDTH x FULLSIZE_HEIGHT
+ (newWidth, newHeight) = self.__resizeWithRatio(cover.size[PIL_WIDTH], cover.size[PIL_HEIGHT], FULLSIZE_WIDTH, FULLSIZE_HEIGHT)
+
+ # Resize it
+! cover = cover.resize((newWidth, newHeight), PIL.Image.ANTIALIAS)
+
+ # We're done
+ cover.save(outFile, format)
+***************
+*** 144,154 ****
+
+ def generateThumbnail(self, inFile, outFile, format):
+ """ Generate a thumbnail from inFile (e.g., resize it) and write it to outFile (outFile and inFile may be equal) """
+! import Image
+
+ try:
+ # Open the image
+! cover = Image.open(inFile).convert('RGBA')
+
+ # Fit the image into THUMBNAIL_WIDTH x THUMBNAIL_HEIGHT
+ (newWidth, newHeight) = self.__resizeWithRatio(cover.size[PIL_WIDTH], cover.size[PIL_HEIGHT], THUMBNAIL_WIDTH, THUMBNAIL_HEIGHT)
+--- 144,154 ----
+
+ def generateThumbnail(self, inFile, outFile, format):
+ """ Generate a thumbnail from inFile (e.g., resize it) and write it to outFile (outFile and inFile may be equal) """
+! import PIL.Image
+
+ try:
+ # Open the image
+! cover = PIL.Image.open(inFile).convert('RGBA')
+
+ # Fit the image into THUMBNAIL_WIDTH x THUMBNAIL_HEIGHT
+ (newWidth, newHeight) = self.__resizeWithRatio(cover.size[PIL_WIDTH], cover.size[PIL_HEIGHT], THUMBNAIL_WIDTH, THUMBNAIL_HEIGHT)
+***************
+*** 161,176 ****
+ else: offsetY = 0
+
+ # Resize the image
+! cover = cover.resize((newWidth, newHeight), Image.ANTIALIAS)
+
+ # Paste the resized cover into our model
+! model = Image.open(THUMBNAIL_MODEL).convert('RGBA')
+ model.paste(cover, (THUMBNAIL_OFFSETX + offsetX, THUMBNAIL_OFFSETY + offsetY), cover)
+ cover = model
+
+ # Don't apply the gloss effect if asked to
+ if not prefs.getCmdLine()[0].no_glossy_cover:
+! gloss = Image.open(THUMBNAIL_GLOSS).convert('RGBA')
+ cover.paste(gloss, (0, 0), gloss)
+
+ # We're done
+--- 161,176 ----
+ else: offsetY = 0
+
+ # Resize the image
+! cover = cover.resize((newWidth, newHeight), PIL.Image.ANTIALIAS)
+
+ # Paste the resized cover into our model
+! model = PIL.Image.open(THUMBNAIL_MODEL).convert('RGBA')
+ model.paste(cover, (THUMBNAIL_OFFSETX + offsetX, THUMBNAIL_OFFSETY + offsetY), cover)
+ cover = model
+
+ # Don't apply the gloss effect if asked to
+ if not prefs.getCmdLine()[0].no_glossy_cover:
+! gloss = PIL.Image.open(THUMBNAIL_GLOSS).convert('RGBA')
+ cover.paste(gloss, (0, 0), gloss)
+
+ # We're done \ No newline at end of file