nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.71k stars 4k forks source link

EPub preview with their embeded image #39085

Open smarinier opened 1 year ago

smarinier commented 1 year ago

Principle

Having a picture preview when displaying EPub (.epub) files in Files (as it is done for images, PDF, OpenDocument...).

As NextCloud can be used as a document, images and books contents, it is pleasant to have this files with their graphical preview. Especially when you have many.

Request for validation of a new feature

I've implemented my own EPub preview in NextCloud code. I'd just like to know if there's anyone who might be interested, before starting a PR.

This looks like:

Public_Books_-_Files_-_Nextcloud

Enabled or not ?

If interested by that : EPub preview should be enabled by default or not ?

The status of enabled Preview is not really clear. It says "The following providers are disabled by default due to performance or privacy concerns:". Saying that, OpenDocument is in the list but is enabled by default.

So, any opinion on this ?

joshtrichards commented 1 year ago

Hi @smarinier - That's pretty cool!

Since preview providers can be added via apps, that might be a good path to consider - e.g. take a look at how https://github.com/ariselseng/camerarawpreviews adds the provider and registers it.

smarinier commented 1 year ago

Hi, @joshtrichards , I hadn't thought of implementing it this way. It's only one format preview. I don't really imagine building a whole app only for one source code file and i'm not not sure (i hope) NextCloud strategy going that way. If there was a "main common previews" app, i could propose my commit into it. But i didn't find such an app. Another way could be to commit into an "epub reader app". But there are one official and two non official apps. the official epubreader breaks on NC 25 installation (limit of 4000 chars in a field) and doesn't seem to be maintained anymore, and files_reader crashes on NC25, and the third one, the 0.0.1 (!) version app is not downloadable (https failed). Maybe NextCloud organisation should have a look on this subject (books), as NextCloud could be also a "at home" (https://nextcloud.com/athome/) repository solution ;) .

gennaios commented 1 year ago

Such was already implemented as an app here:

https://github.com/Yetangitu/owncloud-apps/blob/master/files_opds/lib/epubpreview.php

I had long ago took just the preview code and updated it to work with an older version of Nextcloud, a few years ago. With some version, there was an integrity check error and I haven't gotten around to fixing that yet. Perhaps you can start with that.

devnoname120 commented 2 months ago

Related: https://github.com/devnoname120/epubviewer/pull/21