[feat] DocumentRegistry: add getProviders() and preferred by weight (#3651)

This is step one toward "open with".

References https://github.com/koreader/koreader/issues/3345

* Fix up some mimetypes
* Add XHTML to supported filetypes
* Add a few image files to MuPDF
	* ".bmp",
	* ".gif",
	* ".hdp",
	* ".j2k",
	* ".jp2",
	* ".jpeg",
	* ".jpg",
	* ".jpx",
	* ".jxr",
	* ".pam",
	* ".pbm",
	* ".pgm",
	* ".png",
	* ".pnm",
	* ".ppm",
	* ".tif",
	* ".tiff",
        * ".wdp",
This commit is contained in:
Frans de Jonge
2018-01-31 20:49:21 +01:00
committed by GitHub
parent 90059221db
commit d714bd3aea
6 changed files with 119 additions and 32 deletions

View File

@@ -6,7 +6,8 @@ local pic = nil
local PicDocument = Document:new{
_document = false,
is_pic = true,
dc_null = DrawContext.new()
dc_null = DrawContext.new(),
provider_name = "Picture Document",
}
function PicDocument:init()
@@ -53,10 +54,10 @@ function PicDocument:getCoverPageImage()
end
function PicDocument:register(registry)
registry:addProvider("jpeg", "image/jpeg", self)
registry:addProvider("jpg", "image/jpeg", self)
registry:addProvider("png", "image/png", self)
registry:addProvider("gif", "image/gif", self)
registry:addProvider("gif", "image/gif", self, 100)
registry:addProvider("jpg", "image/jpeg", self, 100)
registry:addProvider("jpeg", "image/jpeg", self, 100)
registry:addProvider("png", "image/png", self, 100)
end
return PicDocument