Commit Graph

54 Commits (master)

Author SHA1 Message Date
Andy Scherzinger dae7c159f7
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
1 week ago
Varun Patil 4ab40e355f fix(preview): check mime type before processing with Imagick
Signed-off-by: Varun Patil <varunpatil@ucla.edu>
2 months ago
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>
7 months ago
Daniel Kesselberg aa48a5f94f
feat: add preview provider for emf files based on office
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
7 months ago
Joas Schilling 4f7de8ed60
fix!: Remove legacy event dispatching Symfony's GenericEvent
Signed-off-by: Joas Schilling <coding@schilljs.com>
10 months ago
Côme Chilliet 8d5165e8dc
Adapt tests to config value typing
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 year ago
Côme Chilliet 426c0341ff
Use typed version of IConfig::getSystemValue as much as possible
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 year ago
Robin Appelman 382432d4e1
cache formats supported by imagick
turns out this can be quite slow

Signed-off-by: Robin Appelman <robin@icewind.nl>
1 year ago
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>
1 year ago
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>
1 year ago
szaimen f9e9cd270d
Limit-number-of-concurrent-preview-generations
Signed-off-by: Bowen Ding <dbw9580@live.com>
Signed-off-by: szaimen <szaimen@e.mail.de>
2 years ago
Julius Härtl 07e94eca6f
Emit typed event when preview is requested
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2 years ago
Joas Schilling efedb218e3
Fix FFMPEG preview manager
Signed-off-by: Joas Schilling <coding@schilljs.com>
2 years ago
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>
2 years ago
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>
2 years ago
J0WI 047cab8dd2 Use findBinaryPath for previews
Signed-off-by: J0WI <J0WI@users.noreply.github.com>
3 years ago
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>
3 years ago
Julius Härtl b6a24f87a5
Merge pull request #28077 from nextcloud/heicPerformance 3 years ago
tobiasKaminsky f62ec2b47c
Disable HEIC image preview provider for performance concerns
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
3 years ago
John Molakvoæ (skjnldsv) 215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
3 years ago
John Molakvoæ (skjnldsv) d47b84be67
Add SGI and TGA preview support
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
3 years ago
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>
3 years ago
Christoph Wurst d9015a8c94
Format code to a single space around binary operators
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Morris Jobke d7f66c36ac
Fix "misplaced variables" warning of Psalm in PHPDoc statements
Ref #21787

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
4 years ago
Christoph Wurst cb057829f7
Update license headers for 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst 1762a409f9
Merge pull request #20422 from nextcloud/techdebt/format-control-structs-classes-methods
Format control structures, classes, methods and function
4 years ago
Roeland Jago Douma eba3726e1e
Merge pull request #19495 from nextcloud/preview-generate-batch
optimize batch generation of previews
4 years ago
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>
4 years ago
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>
4 years ago
Julius Härtl 124b109bc8
Add preview provider for Krita files
Signed-off-by: Julius Härtl <jus@bitgrid.net>
4 years ago
Julius Härtl a2e671c489
Extract preview from opendocument files
Signed-off-by: Julius Härtl <jus@bitgrid.net>
4 years ago
Christoph Wurst 5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
5 years ago
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>
5 years ago
Roeland Jago Douma 98f91982be
Remove deprecated function createPreview
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
5 years ago
John Molakvoæ (skjnldsv) 4505afe184
Allow IProviderV2 for previews as well
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
5 years ago
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>
5 years ago
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>
6 years ago
Sebastian Steinmetz 6973b82e20 Develop HEIC/HEIF preview support #7406
Signed-off-by: Sebastian Steinmetz <me@sebastiansteinmetz.ch>
6 years ago
Morris Jobke eb51f06a3b
Use ::class statement instead of string
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
6 years ago
Morris Jobke a661f043e1
Remove unneeded semicolon and parentheses
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
6 years ago
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>
6 years ago
Morris Jobke 0eebff152a
Update license headers
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
7 years ago
Morris Jobke 6aac094091
Add PHPDoc
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
7 years ago
Roeland Jago Douma 9bbfb5ffeb
Rewrite old preview endpoint for PreviewManager
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
8 years ago
Morris Jobke 46768e71d9 Merge pull request #2076 from nextcloud/log_preview_access
Dispatch event on preview request
8 years ago
Roeland Jago Douma f07d75a4dd
@since 9.2.0 to @since 11.0.0
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
8 years ago
Roeland Jago Douma 99ada40df4
Dispatch event on preview request
Fixes: #73

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
8 years ago
Roeland Jago Douma 87855aa97b
Added genertor helper & tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
8 years ago
Roeland Jago Douma d720a2fb57
Moved over files_versions
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
8 years ago
Roeland Jago Douma 5466fbf761
Move Ipreview to more of DI thingy
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
8 years ago