Commit Graph

52 Commits

Author SHA1 Message Date
Daniel Kesselberg
475dd60354
fix: use png as preview right away
The initial office preview implementation converted an office document with LibreOffice to PDF, used ImageMagick to extract the first page as JPEG, and passed it OC_Image.

https://github.com/nextcloud/server/pull/10198 changed the implementation to use PNG rather than PDF. OC_Image can use a PNG as a preview right away, so the ImageMagick step is unnecessary.

The registration code was updated to not ask ImageMagick if PDF is supported, as PDFs are no longer used to create office document previews.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2023-11-13 22:00:45 +01:00
Daniel Kesselberg
aa48a5f94f
feat: add preview provider for emf files based on office
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2023-11-13 12:35:54 +01:00
Joas Schilling
4f7de8ed60
fix!: Remove legacy event dispatching Symfony's GenericEvent
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-27 09:57:51 +02:00
Côme Chilliet
8d5165e8dc
Adapt tests to config value typing
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-05 17:42:14 +02:00
Côme Chilliet
426c0341ff
Use typed version of IConfig::getSystemValue as much as possible
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-05 12:50:08 +02:00
Robin Appelman
382432d4e1
cache formats supported by imagick
turns out this can be quite slow

Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-02-13 14:57:06 +01:00
William
fa12219629
Update lib/private/PreviewManager.php
fix lint issue

Co-authored-by: Simon L. <szaimen@e.mail.de>
Signed-off-by: William <william.hak57@gmail.com>
2023-01-18 20:32:09 +01:00
William
1409a7cc92
Update PreviewManager.php
add a check in config.php for a configured movieBinary path.
so now it first checks in config.php if  preview_ffmpeg_path is configured.

Signed-off-by: William <william.hak57@gmail.com>
2023-01-18 16:30:41 +01:00
szaimen
f9e9cd270d
Limit-number-of-concurrent-preview-generations
Signed-off-by: Bowen Ding <dbw9580@live.com>
Signed-off-by: szaimen <szaimen@e.mail.de>
2022-11-05 16:03:01 +08:00
Julius Härtl
07e94eca6f
Emit typed event when preview is requested
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-10-27 14:31:33 +02:00
Joas Schilling
efedb218e3
Fix FFMPEG preview manager
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-09-20 13:22:24 +02:00
Carl Schwan
9b8ca9ad1f
Move findBinaryFinder and isFunctionEnabled away from OC_Helper
findBinaryFinder is now a service that is still private but with some
minor optimization (remove the hasKey check).

isFunctionEnabled is now in OCP\Util

Both function are still keep but all internal usage in nextcloud/server
were migrated to the new usage, so that we can remove it in 26

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-08-23 19:44:04 +02:00
Vincent Petry
9b6a1cc8ae
Send images to imaginary docker to generate previews
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Co-Authored-by: Vincent Petry <vincent@nextcloud.com>
2022-03-17 08:24:07 +01:00
J0WI
047cab8dd2 Use findBinaryPath for previews
Signed-off-by: J0WI <J0WI@users.noreply.github.com>
2021-10-23 23:15:42 +02:00
Roeland Jago Douma
8bc25e3324
Move preview provider registration to bootstrap
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-10-21 10:35:18 +02:00
Julius Härtl
b6a24f87a5
Merge pull request #28077 from nextcloud/heicPerformance 2021-07-21 10:27:19 +02:00
tobiasKaminsky
f62ec2b47c
Disable HEIC image preview provider for performance concerns
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
2021-07-21 09:14:20 +02:00
John Molakvoæ (skjnldsv)
215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +02:00
John Molakvoæ (skjnldsv)
d47b84be67
Add SGI and TGA preview support
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-01-22 10:42:51 +01:00
Roeland Jago Douma
6d4afca7ac Add support for webp
Including handling in OC_Image
But also a preview provider

Of course only works if your php actually supports webp

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2021-01-19 20:17:10 +01:00
Christoph Wurst
d9015a8c94
Format code to a single space around binary operators
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-10-05 20:25:24 +02:00
Morris Jobke
d7f66c36ac
Fix "misplaced variables" warning of Psalm in PHPDoc statements
Ref #21787

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-17 17:46:57 +02:00
Christoph Wurst
cb057829f7
Update license headers for 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-29 11:57:22 +02:00
Christoph Wurst
1762a409f9
Merge pull request #20422 from nextcloud/techdebt/format-control-structs-classes-methods
Format control structures, classes, methods and function
2020-04-10 16:38:23 +02:00
Roeland Jago Douma
eba3726e1e
Merge pull request #19495 from nextcloud/preview-generate-batch
optimize batch generation of previews
2020-04-10 15:57:06 +02:00
Christoph Wurst
caff1023ea
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.

This also removes and empty lines from method/function bodies at the
beginning and end.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 14:19:56 +02:00
Robin Appelman
5cd12cd7c3
allow generating multiple preview sizes for a single file at once
this saves having to do some of the overhead multiple times

Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-04-09 12:50:55 +02:00
Julius Härtl
124b109bc8
Add preview provider for Krita files
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-04-08 16:31:20 +02:00
Julius Härtl
a2e671c489
Extract preview from opendocument files
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-04-08 16:24:10 +02:00
Christoph Wurst
5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-05 15:38:45 +01:00
Roeland Jago Douma
68748d4f85
Some php-cs fixes
* Order the imports
* No leading slash on imports
* Empty line before namespace
* One line per import
* Empty after imports
* Emmpty line at bottom of file

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-22 20:52:10 +01:00
Roeland Jago Douma
98f91982be
Remove deprecated function createPreview
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-09-15 10:52:34 +02:00
John Molakvoæ (skjnldsv)
4505afe184
Allow IProviderV2 for previews as well
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2019-07-05 13:57:46 +02:00
Robin Appelman
6150614374
Add new Provider interface for preview providers
the main difference is passing the `File` object to the provider
instead of a `View` + path

Old providers will still continue to work as before

Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-06-17 14:09:09 +02:00
Roeland Jago Douma
ade61d8b43
Allow the creationg of previews of files stored in appdata
To allow us to create previews of files stored in appdata we need to
construct the view differently.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-10-08 19:37:45 +02:00
Sebastian Steinmetz
6973b82e20 Develop HEIC/HEIF preview support #7406
Signed-off-by: Sebastian Steinmetz <me@sebastiansteinmetz.ch>
2018-08-11 00:13:43 +02:00
Morris Jobke
eb51f06a3b
Use ::class statement instead of string
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-29 12:03:47 +01:00
Morris Jobke
a661f043e1
Remove unneeded semicolon and parentheses
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-26 23:46:40 +01:00
Morris Jobke
3d4c698f44
Improve OC_Image code to not guess the type of input, but actually request the specific methods to be called
Followup to #7836

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-18 13:40:55 +01:00
Morris Jobke
0eebff152a
Update license headers
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-06 16:56:19 +01:00
Morris Jobke
6aac094091
Add PHPDoc
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-05-02 13:43:47 +02:00
Roeland Jago Douma
9bbfb5ffeb
Rewrite old preview endpoint for PreviewManager
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-01-04 16:51:44 +01:00
Morris Jobke
46768e71d9 Merge pull request #2076 from nextcloud/log_preview_access
Dispatch event on preview request
2016-11-18 20:45:29 +01:00
Roeland Jago Douma
f07d75a4dd
@since 9.2.0 to @since 11.0.0
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2016-11-15 18:51:52 +01:00
Roeland Jago Douma
99ada40df4
Dispatch event on preview request
Fixes: #73

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2016-11-10 14:28:09 +01:00
Roeland Jago Douma
87855aa97b
Added genertor helper & tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2016-11-03 14:00:33 +01:00
Roeland Jago Douma
d720a2fb57
Moved over files_versions
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2016-11-03 14:00:33 +01:00
Roeland Jago Douma
5466fbf761
Move Ipreview to more of DI thingy
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2016-11-03 14:00:33 +01:00
Joas Schilling
0215b004da
Update with robin 2016-07-21 18:13:58 +02:00
Joas Schilling
ba87db3fcc
Fix others 2016-07-21 18:13:57 +02:00