Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: choose document provider for filetype #3345

Closed
Frenzie opened this issue Oct 11, 2017 · 0 comments
Closed

FR: choose document provider for filetype #3345

Frenzie opened this issue Oct 11, 2017 · 0 comments
Assignees

Comments

@Frenzie
Copy link
Member

Frenzie commented Oct 11, 2017

  • KOReader version: a394e64
  • Device: all

Issue

The DocumentRegistry merely returns the first match, which is tailored to what we know to work well in most cases. For example, PdfDocument handles .zip and CreDocument handles .otherthings.zip.

--- Returns the registered document handler.
-- @string file
-- @treturn string provider, or nil
function DocumentRegistry:getProvider(file)
-- TODO: some implementation based on mime types?
for _, provider in ipairs(self.providers) do
local suffix = string.sub(file, -string.len(provider.extension) - 1)
if string.lower(suffix) == "."..provider.extension then
-- if extension == provider.extension then
return provider.provider
end
end
end

But for certain filetypes we might want to choose which engine to use. Like the zip mentioned above, or even for EPUB when we bump MuPDF to a more recent version.

@Frenzie Frenzie self-assigned this Jan 31, 2018
Frenzie added a commit to Frenzie/koreader that referenced this issue Jan 31, 2018
Frenzie added a commit to Frenzie/koreader that referenced this issue Jan 31, 2018
Frenzie added a commit to Frenzie/koreader that referenced this issue Jan 31, 2018
Frenzie added a commit to Frenzie/koreader that referenced this issue Jan 31, 2018
Frenzie added a commit to Frenzie/koreader that referenced this issue Jan 31, 2018
This is step one toward "open with".

References koreader#3345

* Fix up some mimetypes
* Add XHTML to supported filetypes
Frenzie added a commit to Frenzie/koreader that referenced this issue Jan 31, 2018
This is step one toward "open with".

References koreader#3345

* Fix up some mimetypes
* Add XHTML to supported filetypes
Frenzie added a commit to Frenzie/koreader that referenced this issue Jan 31, 2018
This is step one toward "open with".

References koreader#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",
Frenzie added a commit that referenced this issue Jan 31, 2018
…3651)

This is step one toward "open with".

References #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",
Frenzie added a commit to Frenzie/koreader that referenced this issue Feb 1, 2018
Frenzie added a commit to Frenzie/koreader that referenced this issue Feb 1, 2018
Frenzie added a commit to Frenzie/koreader that referenced this issue Feb 1, 2018
Frenzie added a commit to Frenzie/koreader that referenced this issue Feb 1, 2018
Frenzie added a commit to Frenzie/koreader that referenced this issue Feb 1, 2018
Frenzie added a commit to Frenzie/koreader that referenced this issue Feb 1, 2018
Frenzie added a commit to Frenzie/koreader that referenced this issue Feb 1, 2018
Frenzie added a commit that referenced this issue Feb 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant