View Single Post
Old 07-14-2019, 04:51 PM   #127
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,695
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
The first two problems are related to Pillow and the last one is an actual bug that I'll fix in the next plugin version.

Try the following workarounds:

1. Delete or comment the following section (lines 116-119)

Spoiler:
Code:
        # /Applications/Kindle Previewer 4.app/Contents/MacOS/lib/kindlegen/fc/bin/kindlegen [*** for future versions ***]
        default_osx_path2 = os.path.join('/Applications', 'Kindle Previewer 4.app', 'Contents', 'MacOS', 'lib', 'fc', 'bin', 'kindlegen')
        if os.path.isfile(default_osx_path3):
            kg_path = default_osx_path3


2. Delete or comment out the following section (492-500):

Spoiler:
Code:
        # look for cover image
        cover_id = None
        cover_item = opf_soup.find('item', {'properties' : 'cover-image'})
        if cover_item:
            cover_href = cover_item['href']
            cover_id = bk.href_to_id(cover_href)
            cover_def = os.path.basename(cover_href)
        else:
            plugin_warnings += '\nWarning: Cover not specified (cover-image property missing).'


3. Delete or comment out the following section (lines 555-569)

Spoiler:
Code:
    #------------------------------
    # check minimum cover width 
    #------------------------------
    img = None
    if cover_id and os.path.splitext(bk.id_to_href(cover_id))[1][1:].upper() != 'SVG':
        imgdata = bk.readfile(cover_id)
        img = Image.open(BytesIO(imgdata)).convert('L')
        width, height = img.size
        if width < 500:
            plugin_warnings += '\nWarning: The cover is too small: ' + str(width) + ' x ' + str(height)
        # check recommended dpi
        if prefs['check_dpi'] == True:
            xdpi, ydpi = img.info['dpi']
            if (int(xdpi) or int(ydpi)) < 300:
                plugin_warnings += '\nInfo: Amazon recommends 300 dpi cover images. Your image has: ' + str(int(xdpi)) + ' x ' + str(int(ydpi)) + ' dpi.'

3. Make sure to also uncheck the Generate Thumbnail option in the GUI.

With these changes in place you should be able to run the plugin again.
Doitsu is offline   Reply With Quote