summaryrefslogtreecommitdiffstats
path: root/lib/private/Preview
Commit message (Collapse)AuthorAgeFilesLines
* Bump nextcloud/coding-standard from 0.3.0 to 0.5.0dependabot-preview[bot]2021-02-185-6/+6
| | | | | | | | | | Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard) from 0.3.0 to 0.5.0. - [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/v0.3.0...v0.5.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Markdown: remove redundant int castRoeland Jago Douma2021-02-151-1/+1
| | | | | | For #25641 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix WebP availability checkRoeland Jago Douma2021-02-111-1/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add SGI and TGA preview supportJohn Molakvoæ (skjnldsv)2021-01-222-0/+66
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Fix typo in comment Morris Jobke2021-01-201-1/+1
| | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Enhance markdown file preview renderingJulius Härtl2021-01-201-0/+110
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Add support for webpRoeland Jago Douma2021-01-191-0/+42
| | | | | | | | | 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>
* Remove unneeded casts that were found by PsalmMorris Jobke2021-01-111-1/+1
| | | | | | In preparation of the update of Psalm from 4.2.1 to 4.3.1+ (see https://github.com/nextcloud/server/pull/24521) Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Update license headersChristoph Wurst2020-12-301-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #22916 from J0WI/unifiy-links-to-php.netRoeland Jago Douma2020-12-221-1/+1
|\ | | | | Unify links to php.net
| * Unify links to php.netJ0WI2020-09-171-1/+1
| | | | | | | | | | | | Update all links to https://www.php.net/ Signed-off-by: J0WI <J0WI@users.noreply.github.com>
* | Format code to a single space around binary operatorsChristoph Wurst2020-10-051-1/+1
|/ | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update the license headers for Nextcloud 20Christoph Wurst2020-08-242-0/+4
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Always try and show pre rendered previewScott Dutton2020-08-131-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Currently if the following situation happens Server generates preview Server has command removed which allows a preview to be shown Client asks for preview, gets a 404 error when preview exists (Mime checked before preview) This happens more often with documents, or video as the commands are not native PHP, they require a binary on the server. After the fix the following would happen Server generates preview Server has command removed which allows a preview to be shown Client asks for preview, gets preview which has been generated (Mime checked after preview) This would also allow offline generation (for example a docker image containing the extra binaries), allowing a reduction in attack surface of the instance serving the preview data. Signed-off-by: Scott Dutton <scott@exussum.co.uk>
* Merge pull request #22139 from ↵Morris Jobke2020-08-071-9/+14
|\ | | | | | | | | nextcloud/fix/noid/check-for-preview-multibucket-fallback-as-second-step Check previews in multibucket fallback folder as the last step and not as first step
| * Check previews in multibucket fallback folder as the last step and not as ↵Morris Jobke2020-08-071-9/+14
| | | | | | | | | | | | first step Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* | Merge pull request #22135 from nextcloud/enh/noid/occ-preview-repairMorris Jobke2020-08-071-3/+3
|\ \ | |/ |/| Add occ preview:migrate to migrate previews from the old flat structure to a subfolder structure
| * Add occ preview:migrate to migrate previews from the old flat structure to a ↵Morris Jobke2020-08-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | subfolder structure * `php occ preview:repair` - a preview migration tool that moves existing previews into the new location introduced with #19214 * moves `appdata_INSTANCEID/previews/FILEID` to `appdata_INSTANCEID/previews/0/5/8/4/c/e/5/FILEID` * migration tool can be stopped during migration via `CTRL+C` - it then finishes the current folder (with the previews of one file) and stops gracefully * if a PHP memory limit is set in the `php.ini` then it will stop automatically once it has less than 25 MiB memory left (this is to avoid hard crashes in the middle of a migration) * the tool can be used during operation - possible drawbacks: * there is the chance of a race condition that a new preview is generated in the moment the folder is already migrated away - so the old folder with the newly cached preview is deleted and one cached preview needs to be re-generated * there is the chance of a race condition during access of a preview while it is migrated to the other folder - then no preview can be shown and results in a 404 (as of now this is an accepted risk) Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* | Add config option to enable multibucket preview distributionMorris Jobke2020-08-061-9/+9
| | | | | | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* | Mount the old previews in a separate folder for the multi bucket setup and ↵Morris Jobke2020-08-061-0/+11
| | | | | | | | | | | | check in them before using the actual locations Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* | Distribute preview folders in appdata in multibucket setup to multiple bucketsMorris Jobke2020-08-061-1/+0
|/ | | | | | | | | * introduces a new IRootMountProvider to register mount points inside the root storage * adds a AppdataPreviewObjectStoreStorage to handle the split between preview folders and bucket number Ref #22033 Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Use class that actually has the destroy() method in preview generatorMorris Jobke2020-08-051-1/+1
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* fix memory leak caused by not destroying image in Preview/Generate.phpElijah Martin-Merrill2020-07-271-0/+6
| | | | Signed-off-by: Elijah Martin-Merrill <elijah@nyp-itsours.com>
* Update license headers for 19Christoph Wurst2020-04-297-3/+8
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Move to subfolders for preview filesRoeland Jago Douma2020-04-192-16/+149
| | | | | | | | | | | Else the number of files can grow very large very quickly in the preview folder. Esp on large systems. This generates the md5 of the fileid. And then creates folders of the first 7 charts. In that folder is then a folder with the fileid. And inside there are the previews. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Merge pull request #20422 from ↵Christoph Wurst2020-04-109-14/+5
|\ | | | | | | | | nextcloud/techdebt/format-control-structs-classes-methods Format control structures, classes, methods and function
| * Format control structures, classes, methods and functionChristoph Wurst2020-04-109-14/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge pull request #19495 from nextcloud/preview-generate-batchRoeland Jago Douma2020-04-101-41/+71
|\ \ | |/ |/| optimize batch generation of previews
| * fix preview generation testsRobin Appelman2020-04-101-2/+2
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
| * optimize batch generation of previewsRobin Appelman2020-04-091-7/+11
| | | | | | | | | | | | | | | | | | | | by allowing the generation of multiple previews at once we save on having to find, open and decode the max-preview for every preview of the same file the main use case for this is the preview generator app (pr for that comming next) in my local testing this saves about 25% of time when using the preview generator app Signed-off-by: Robin Appelman <robin@icewind.nl>
| * allow generating multiple preview sizes for a single file at onceRobin Appelman2020-04-091-34/+60
| | | | | | | | | | | | this saves having to do some of the overhead multiple times Signed-off-by: Robin Appelman <robin@icewind.nl>
* | Use elseif instead of else ifChristoph Wurst2020-04-101-1/+1
| | | | | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | Fix (array) indent style to always use one tabChristoph Wurst2020-04-091-3/+3
| | | | | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | Add preview provider for Krita filesJulius Härtl2020-04-082-4/+54
| | | | | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* | Extract preview from opendocument filesJulius Härtl2020-04-081-1/+16
| | | | | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* | Add abstract class to extract previews from files that are zip archivesJulius Härtl2020-04-081-0/+58
|/ | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Update the license headers for Nextcloud 19Christoph Wurst2020-03-311-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Remove unused importsChristoph Wurst2020-03-252-3/+0
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fix mismatching doc block parameter typesChristoph Wurst2020-03-061-1/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Proper text previewsRoeland Jago Douma2020-01-141-1/+1
| | | | | | | | | | | Fixes #17828 * Modified the preview provider to provider smaller fonts for the previes (so it is not so screaming) * Modified the sidebar to show plain text and markdown files full size. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl> Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
* Fix license headersChristoph Wurst2020-01-131-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #18536 from nextcloud/enhancement/preview-center-verticallyRoeland Jago Douma2019-12-231-1/+1
|\ | | | | Also center vertically when cropping previews
| * Also center vertically when cropping previewsJohn Molakvoæ (skjnldsv)2019-12-221-1/+1
| | | | | | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* | Merge pull request #18511 from Al2Klimov/bugfix/movie-getthumbnailRoeland Jago Douma2019-12-221-2/+2
|\ \ | |/ |/| Movie#getThumbnail(): compare Movie#generateThumbNail() to null, not false
| * Movie#getThumbnail(): compare Movie#generateThumbNail() to null, not falseAlexander A. Klimov2019-12-211-2/+2
| | | | | | | | Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de>
* | Fix Office preview generationRoeland Jago Douma2019-12-181-1/+1
|/ | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Update license headersChristoph Wurst2019-12-0533-43/+109
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Some php-cs fixesRoeland Jago Douma2019-11-2219-7/+23
| | | | | | | | | | | * 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>
* #17661Daniel Schneider2019-10-301-1/+1
|
* Explicit cast for ProviderV1AdapterJulius Härtl2019-08-201-2/+2
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>