View Single Post
Old 09-08-2014, 10:48 AM   #1628
WS64
WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.WS64 ought to be getting tired of karma fortunes by now.
 
WS64's Avatar
 
Posts: 661
Karma: 506380
Join Date: Aug 2010
Location: Germany
Device: Kobo Aura / PB Lux 2 / Bookeen Frontlight / Kobo Mini / Nook Color
Quote:
Originally Posted by embryo View Post
A question for the developers.

Is there a way (a setting in some lua file) to make koreader use my custom cover for Pdf files but continue to use the ones from the epubs.
The reason for that is that many of my pdfs don't have covers, or if they have they're not so good.
I don't think we will have a general way to do that.
If you want to change the code (after each nightly) edit frontend/ui/screensaver.lua and change this function:

Code:
function Screensaver:getCoverImage(file)
    local ImageWidget = require("ui/widget/imagewidget")
    local doc = DocumentRegistry:openDocument(file)
    if doc and (string.lower(string.match(file, ".+%.([^.]+)") or "")=="epub") then
        local image = doc:getCoverPageImage()
        doc:close()
        local extension =  or "")
        if image then
            return ImageWidget:new{
                image = image,
                width = Screen:getWidth(),
                height = Screen:getHeight(),
            }
        end
    end
end
Havn't tested it, but it should make sure that your epubs show their covers and all other files your defualt cover. You could change it also to ~="pdf" instead of =="epub"...
WS64 is offline   Reply With Quote