Skip to content

Use embedded previews of ZIP-like files - #20319

Merged
rullzer merged 5 commits into
masterfrom
enh/noid/embedded-previews
Apr 8, 2020
Merged

Use embedded previews of ZIP-like files#20319
rullzer merged 5 commits into
masterfrom
enh/noid/embedded-previews

Conversation

@juliusknorr

Copy link
Copy Markdown
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.

@juliusknorrjuliusknorr added the 3. to review Waiting for reviews label Apr 5, 2020
@juliusknorrjuliusknorr added this to the Nextcloud 19 milestone Apr 5, 2020

@skjnldsvskjnldsv left a comment

Copy link
Copy Markdown
Member

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 georgehrkeApril 5, 2020 09:09
@juliusknorr

Copy link
Copy Markdown
MemberAuthor

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

@skjnldsv

Copy link
Copy Markdown
Member

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

Ah ok :)

@skjnldsv

skjnldsv commented Apr 5, 2020

Copy link
Copy Markdown
Member

Code looks good!

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

@juliusknorr

Copy link
Copy Markdown
MemberAuthor

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

Comment threadlib/private/Preview/Krita.php Outdated
@@ -0,0 +1,53 @@
<?php
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.

Copy link
Copy Markdown
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
Copy Markdown
Contributor

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.

Comment threadlib/private/Preview/Bundled.php
Comment threadlib/private/Preview/Bundled.php Outdated
@rullzerrullzer mentioned this pull request Apr 7, 2020
80 tasks
@rullzer

Copy link
Copy Markdown
Member

@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>
@juliusknorr
juliusknorrforce-pushed the enh/noid/embedded-previews branch from e843c89 to 5d27ed5CompareApril 8, 2020 14:31
@juliusknorr

Copy link
Copy Markdown
MemberAuthor

Done

@juliusknorrjuliusknorr 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 masterApr 8, 2020
@rullzer
rullzer deleted the enh/noid/embedded-previews branch April 8, 2020 17:33
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to releaseReady to be released and/or waiting for tests to finishenhancementfeature: previews and thumbnails

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@juliusknorr@skjnldsv@kesselb@rullzer@nickvergessen