Commit Graph

66 Commits (660f3f6fd1ae5539b8f74bfa48859d1b9f1e6abf)

Author SHA1 Message Date
Ferdinand Thiessen 660f3f6fd1
refactor: use logical `&&` `||` instead of weak `and` `or` operators
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-09-27 23:02:18 +07:00
provokateurin 4b2a93cf0a
chore(Preview): Remove avconv support
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-08-27 20:51:08 +07:00
Julien Veyssier c7e9f2c03d
fix(PreviewManager): use the forced mimetype in throwIfPreviewsDisabled
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2025-06-02 15:50:53 +07:00
Akhil e537500c8e fix: Throw exception in PreviewManager when preview is not available
Signed-off-by: Akhil <akhil@e.email>
2025-05-20 13:17:40 +07:00
Louis Chemineau 2238548278
feat(previews): Support in memory preview request
This allows callers to use the API without increasing the disk usage.

Example: blurhash generation, where we request a preview for all uploaded pictures, but don't want to necessarily store that preview.
Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-05-05 10:38:51 +07:00
nfebe 6b89838cc2 feat: add logging to preview generation
Signed-off-by: nfebe <fenn25.fn@gmail.com>
2025-04-17 14:24:18 +07:00
Pauli Järvinen b165523589 fix(preview): Do not try to parse M3U files as MP3
By default, the MP3 audio files get the mimetype `audio/mpeg` and the M3U and
M3U8 playlist files get the mimetype `audio/mpegurl`. PreviewManager had such
a problem that it registered the MP3 preview provider with a regular
expression which matched also the M3U files. This caused an error message to
be logged on the info (1) level for each M3U file every time a folder with
such files was viewed: "Error while getting cover from mp3 file:
File /path/to/some/playlist.m3u is not mpeg/audio!".

Signed-off-by: Pauli Järvinen <pauli.jarvinen@gmail.com>
2025-01-06 12:51:40 +07:00
dependabot[bot] bb598c8451
chore(deps): Bump nextcloud/coding-standard in /vendor-bin/cs-fixer
Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/nextcloud/coding-standard/releases)
- [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nextcloud/coding-standard/compare/v1.3.1...v1.3.2)

---
updated-dependencies:
- dependency-name: nextcloud/coding-standard
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-10-19 07:57:35 +07:00
provokateurin 9836e9b164
chore(deps): Update nextcloud/coding-standard to v1.3.1
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-19 14:21:20 +07:00
Daniel Kesselberg af6de04e9e
style: update codestyle for coding-standard 1.2.3
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-08-25 19:34:58 +07:00
ernolf a8bdd4f99b
feat(preview): move previews for imaginary pdf to own class ImaginaryPDF
Signed-off-by: ernolf <raphael.gradenwitz@googlemail.com>

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-07-25 17:01:01 +07:00
Daniel Kesselberg d270561ef8 fix(preview): don't create folder structure when previews are disabled
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-06-18 10:39:45 +07:00
Andy Scherzinger dae7c159f7
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-24 13:11:22 +07:00
Varun Patil 4ab40e355f fix(preview): check mime type before processing with Imagick
Signed-off-by: Varun Patil <varunpatil@ucla.edu>
2024-04-08 10:22:17 +07:00
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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07:00
Joas Schilling efedb218e3
Fix FFMPEG preview manager
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-09-20 13:22:24 +07: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 +07: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 +07:00
J0WI 047cab8dd2 Use findBinaryPath for previews
Signed-off-by: J0WI <J0WI@users.noreply.github.com>
2021-10-23 23:15:42 +07: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 +07:00
Julius Härtl b6a24f87a5
Merge pull request #28077 from nextcloud/heicPerformance 2021-07-21 10:27:19 +07:00
tobiasKaminsky f62ec2b47c
Disable HEIC image preview provider for performance concerns
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
2021-07-21 09:14:20 +07:00
John Molakvoæ (skjnldsv) 215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +07: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 +07: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 +07: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 +07: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 +07:00
Christoph Wurst cb057829f7
Update license headers for 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-29 11:57:22 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07:00
Christoph Wurst 5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-05 15:38:45 +07: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 +07:00
Roeland Jago Douma 98f91982be
Remove deprecated function createPreview
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-09-15 10:52:34 +07: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 +07: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 +07: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 +07:00
Sebastian Steinmetz 6973b82e20 Develop HEIC/HEIF preview support #7406
Signed-off-by: Sebastian Steinmetz <me@sebastiansteinmetz.ch>
2018-08-11 00:13:43 +07:00