mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
refactor(doc): use ffi binding in picdocument
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
local Document = require("document/document")
|
||||
local DrawContext = require("ffi/drawcontext")
|
||||
local pic = nil
|
||||
|
||||
local PicDocument = Document:new{
|
||||
_document = false,
|
||||
@@ -7,7 +8,7 @@ local PicDocument = Document:new{
|
||||
}
|
||||
|
||||
function PicDocument:init()
|
||||
require "libs/libkoreader-pic"
|
||||
if not pic then pic = require("ffi/pic") end
|
||||
ok, self._document = pcall(pic.openDocument, self.file)
|
||||
if not ok then
|
||||
self.error_message = "failed to open jpeg image"
|
||||
|
||||
Reference in New Issue
Block a user