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

Use embedded previews of ZIP-like files #20319

Merged
merged 5 commits into from
Apr 8, 2020
Merged

Conversation

juliushaertl
Copy link
Member

Some filetypes like OpenDocument are basically just zip files and contain a preview image already that we can extract to provide previews without requiring external dependencies.

This implements an abstract class to extract as well as two providers for OpenDocument and Krita files.

@juliushaertl juliushaertl added the 3. to review Waiting for reviews label Apr 5, 2020
@juliushaertl juliushaertl added this to the Nextcloud 19 milestone Apr 5, 2020
Copy link
Member

@skjnldsv skjnldsv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is so awesome!!
Code looks good!

Maybe some tests? 🙈

@skjnldsv skjnldsv requested a review from georgehrke April 5, 2020 09:09
@juliushaertl
Copy link
Member Author

Hm, not sure how I can properly write tests for that as the preview providers don't support DI yet.

@skjnldsv
Copy link
Member

skjnldsv commented Apr 5, 2020

Hm, not sure how I can properly write tests for that as the preview providers don't support DI yet.

Ah ok :)

@skjnldsv
Copy link
Member

skjnldsv commented Apr 5, 2020

Code looks good!

Ah, that was not done! I was happy this looked so simple with the first commits 🙈

@juliushaertl
Copy link
Member Author

It is now, I just forgot to push a new file and bump the autoloader.

@@ -0,0 +1,53 @@
<?php
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope

@kesselb
Copy link
Contributor

kesselb commented Apr 5, 2020

Nice 👍 Works for me 🎉

/**
* Only register providers that have been explicitly enabled
*
* The following providers are disabled by default due to performance or privacy
* concerns:
*
* - OC\Preview\Illustrator
* - OC\Preview\Movie
* - OC\Preview\MSOffice2003
* - OC\Preview\MSOffice2007
* - OC\Preview\MSOfficeDoc
* - OC\Preview\OpenDocument
* - OC\Preview\PDF
* - OC\Preview\Photoshop
* - OC\Preview\Postscript
* - OC\Preview\StarOffice
* - OC\Preview\SVG
* - OC\Preview\TIFF
* - OC\Preview\Font
*
* The following providers are not available in Microsoft Windows:
*
* - OC\Preview\Movie
* - OC\Preview\MSOfficeDoc
* - OC\Preview\MSOffice2003
* - OC\Preview\MSOffice2007
* - OC\Preview\OpenDocument
* - OC\Preview\StarOffice
*
* Defaults to the following providers:
*
* - OC\Preview\BMP
* - OC\Preview\GIF
* - OC\Preview\HEIC
* - OC\Preview\JPEG
* - OC\Preview\MarkDown
* - OC\Preview\MP3
* - OC\Preview\PNG
* - OC\Preview\TXT
* - OC\Preview\XBitmap
*/
'enabledPreviewProviders' => [
'OC\Preview\PNG',
'OC\Preview\JPEG',
'OC\Preview\GIF',
'OC\Preview\HEIC',
'OC\Preview\BMP',
'OC\Preview\XBitmap',
'OC\Preview\MP3',
'OC\Preview\TXT',
'OC\Preview\MarkDown'
],
Please update accordingly.

lib/private/Preview/Bundled.php Show resolved Hide resolved
lib/private/Preview/Bundled.php Outdated Show resolved Hide resolved
@rullzer rullzer mentioned this pull request Apr 7, 2020
80 tasks
@rullzer
Copy link
Member

rullzer commented Apr 8, 2020

@juliushaertl please address the comments and we can get this in

Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
@juliushaertl
Copy link
Member Author

Done

@juliushaertl juliushaertl added 4. to release Ready to be released and/or waiting for tests to finish enhancement feature: previews and thumbnails and removed 3. to review Waiting for reviews labels Apr 8, 2020
@rullzer rullzer merged commit 37146c9 into master Apr 8, 2020
@rullzer rullzer deleted the enh/noid/embedded-previews branch April 8, 2020 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish enhancement feature: previews and thumbnails
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants