2009-04-16, 18:09
Resizing the fanart is always one of the first things that people suggest for reducing memory useage on the Xbox. Would it be possible to create a script to automate this within XBMC?
joebrady Wrote:Well, once you get them all done and transferred, you could use a program like Media Companion or MIP, both have options for re-sizing the fanart that they download.
"""
Module for creating thumbs
"""
import sys
import os
#sys.path.append( os.path.join( os.path.dirname( sys.modules[ "pil_util" ].__file__ ), "_PIL.zip" ) )
from PIL import Image, ImageEnhance
def makeThumbnails( poster ):
try:
# setup thumb names and size
size = ( 104, 154, )#( 26, 38 )261x385
thumbnail = "%s.png" % ( os.path.splitext( poster )[0], )
watched_thumbnail = "%s-w.png" % ( os.path.splitext( poster )[0], )
# open poster jpeg
im = Image.open( poster )
# create thumbnail
im.thumbnail( size, Image.ANTIALIAS )
im = im.convert( "RGBA" )
im.save( thumbnail, "PNG" )
# create watched thumbnail
alpha = im.split()[ 3 ]
alpha = ImageEnhance.Brightness( alpha ).enhance( 0.2 )
im.putalpha( alpha )
im.save( watched_thumbnail, "PNG" )
return True
except:
return False