mirror of https://github.com/koreader/koreader
Merge remote-tracking branch 'upstream/master'
resolved conflicts with refactored structurepull/334/head
commit
748a443cd5
@ -0,0 +1,31 @@
|
||||
local Document = require("document/document")
|
||||
-- DrawContext
|
||||
|
||||
local PicDocument = Document:new{
|
||||
_document = false,
|
||||
dc_null = DrawContext.new(),
|
||||
}
|
||||
|
||||
function PicDocument:init()
|
||||
ok, self._document = pcall(pic.openDocument, self.file)
|
||||
if not ok then
|
||||
self.error_message = "failed to open jpeg image"
|
||||
return
|
||||
end
|
||||
|
||||
self.info.has_pages = true
|
||||
self.info.configurable = false
|
||||
|
||||
self:readMetadata()
|
||||
end
|
||||
|
||||
function PicDocument:readMetadata()
|
||||
self.info.number_of_pages = 1
|
||||
end
|
||||
|
||||
function PicDocument:register(registry)
|
||||
registry:addProvider("jpeg", "application/jpeg", self)
|
||||
registry:addProvider("jpg", "application/jpeg", self)
|
||||
end
|
||||
|
||||
return PicDocument
|
Loading…
Reference in New Issue