summaryrefslogtreecommitdiffstats
path: root/lib/private/Preview
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Merge pull request #16307 from ↵Roeland Jago Douma2019-07-091-1/+1
|\ | | | | | | | | nextcloud/bugfix/noid/previewv1adapter-isAvailable Fix ProviderV1Adapter isAvailable wrapper
| * Fix ProviderV1Adapter isAvailable wrapperJulius Härtl2019-07-091-1/+1
| | | | | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* | allow keeping multiple preview "versions" of the same fileRobin Appelman2019-07-081-17/+29
|/ | | | | | | | | | | The main use case here is storage provided versioning where we dont have separate file ids for all the versions, by allowing a prefix for the version we can store separate previews for all the versions. Additionally, by keeping all the version previews in the same folder as the "normal" previews they will be cleaned up properly when the file is deleted Signed-off-by: Robin Appelman <robin@icewind.nl>
* Allow IProviderV2 for previews as wellJohn Molakvoæ (skjnldsv)2019-07-051-2/+1
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Merge pull request #16055 from nextcloud/design/native-fontsJan-Christoph Borchardt2019-06-261-1/+1
|\ | | | | Use native font stack
| * Move font from Nunito to Noto SansJan-Christoph Borchardt2019-06-221-1/+1
| | | | | | | | Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
* | Add new Provider interface for preview providersRobin Appelman2019-06-1729-133/+280
|/ | | | | | | | | 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>
* Reduce text size of text file preview, fix #13720Jan-Christoph Borchardt2019-01-231-2/+3
| | | | Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
* Only generate previews in powers of 4 and set minRoeland Jago Douma2018-10-311-7/+11
| | | | | | | | | | | | | | | Before we'd round up all preview request to their nearest power of two. This resulted still in a lot of possible images. Generating a lot of server load and taking up a lot of space. This moves it to previews to be powers of 4: 64, 256, 1024 and 4096 Also the first two powers are always skipped (4, 16) as it doesn't make sense to generate previews for that. We cache preview pretty agressively and I feel this is a better tradeoff. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Use correct typeface for txt previewsJan-Christoph Borchardt2018-10-231-1/+1
| | | | Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
* Allow the creationg of previews of files stored in appdataRoeland Jago Douma2018-10-081-11/+8
| | | | | | | 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>
* FixesRoeland Jago Douma2018-08-241-5/+8
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* HEIC previews as JPG rather than PNGs to save space.Sebastian Steinmetz2018-08-241-2/+99
| | | Signed-off-by: Sebastian Steinmetz <me@sebastiansteinmetz.ch>
* Merge pull request #10526 from steiny2k/HEICHEIFMorris Jobke2018-08-221-0/+40
|\ | | | | Support HEIC for previews
| * Address comments from @rullzer:Sebastian Steinmetz2018-08-171-0/+8
| | | | | | | | | | | | | | - implement isAvailable - run tests only if ImageMagick with HEIC support is available in the environment Signed-off-by: Sebastian Steinmetz <me@sebastiansteinmetz.ch>
| * Develop HEIC/HEIF preview support #7406Sebastian Steinmetz2018-08-111-0/+32
| | | | | | Signed-off-by: Sebastian Steinmetz <me@sebastiansteinmetz.ch>
* | Check if a preview provider is available before using itRoeland Jago Douma2018-08-171-0/+4
|/ | | | | | | | Else if a preview provider is registerd but not available (for example missing support in some external lib). It will do :boom:. This way the providers can at least do the sanity checks required. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* No need to convert to PDF with LibreOffice, just convert to PNGTor Lillqvist2018-07-121-9/+9
| | | | | | | | | Exporting all pages of a document to a PDF is a waste of time. All we need is a thumbnail of the first page anyway. Plus, reading that PDF (even just the first page of it) into imagick is presumably much slower than reading a simple PNG. Signed-off-by: Tor Lillqvist <tml@collabora.com>
* Log path of file that failed to be parsedMorris Jobke2018-06-281-1/+1
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Make sure the file is readable before attempting to create a previewRoeland Jago Douma2018-05-301-0/+6
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Delete the previews when a version is restoredRoeland Jago Douma2018-05-142-0/+12
| | | | | | | | | Fixes #9469 When a version of a file is restored the previews are no longer valid. Thus we should remove them so they are regenerated. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Move to joinRoeland Jago Douma2018-05-141-8/+8
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Kill the dete preview watcherRoeland Jago Douma2018-05-142-51/+4
| | | | | | | | | | | | | | This code had the potential to time out. If a huge folder with pictures for example was deleted then this could easily grow the number of files to clean with a factor 5 (or more). Now the previews just get cleaned up in the background. Which is good enough for the 99% case As a bonus this now also keeps the previews when in the trashbin so you don't have a spiking server load when a user opens the trashbin view. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>