RenderImage: factorize all image rendering and scaling code

New module RenderImage (alongside existing RenderText) to provides
image rendering and scaling facilities.
Uses MuPDF, but tries first giflib on GIF.
Allows for getting all the frames from an animated GIF.
This commit is contained in:
poire-z
2018-04-21 22:03:04 +02:00
parent 7a2bf21434
commit 4bb3999cbc
6 changed files with 240 additions and 83 deletions

View File

@@ -270,7 +270,9 @@ function ReaderHighlight:onHold(arg, ges)
end
-- check if we were holding on an image
local image = self.ui.document:getImageFromPosition(self.hold_pos)
-- we provide want_frames=true, so we get a list of images for
-- animated GIFs (supported by ImageViewer)
local image = self.ui.document:getImageFromPosition(self.hold_pos, true)
if image then
logger.dbg("hold on image")
local ImageViewer = require("ui/widget/imageviewer")