Thread: pdftoiliad
View Single Post
Old 07-14-2008, 06:01 PM   #8
IanHelgesen
Member
IanHelgesen has a complete set of Star Wars action figures.IanHelgesen has a complete set of Star Wars action figures.IanHelgesen has a complete set of Star Wars action figures.
 
IanHelgesen's Avatar
 
Posts: 20
Karma: 270
Join Date: Feb 2008
Device: Irex Iliad
Quote:
Originally Posted by kusmi View Post
I also added a bit better contrast (if the title page of the pdf only contains text, the cover icon is hard to read), so the cover code now looks like this:

Code:
#-------- Create thumbnail --------
def make_cover(cover, out):
    """Takes a PIL image and returns the image transformed
    to be used as a thumbnail on the Iliad"""
    if cover:
        try:
            coversize = (69, 93)
            out = os.path.join(out, "cover.png")
            cover = ImageOps.grayscale(cover)
            cover.thumbnail(coversize, Image.ANTIALIAS)
            cover = ImageOps.autocontrast(cover,0)
            cover.save(out)
            return True
        except: return False
    else:
        return False
Again, many thanks for your great tool - it is really useful!!!
Nice work! I'm uploading a new version with your changes. It's nice to see that other people are finding this useful as well.
IanHelgesen is offline   Reply With Quote