[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

@@ -12,6 +12,7 @@ local DjvuDocument = Document:new{
options = KoptOptions,
koptinterface = nil,
color_bb_type = Blitbuffer.TYPE_BBRGB24,
provider_name = "DjVu Libre",
}
-- check DjVu magic string to validate
@@ -136,8 +137,8 @@ function DjvuDocument:drawPage(target, x, y, rect, pageno, zoom, rotation, gamma
end
function DjvuDocument:register(registry)
registry:addProvider("djvu", "application/djvu", self)
registry:addProvider("djv", "application/djvu", self)
registry:addProvider("djv", "image/vnd.djvu", self, 100)
registry:addProvider("djvu", "image/vnd.djvu", self, 100)
end
return DjvuDocument