summaryrefslogtreecommitdiffstats
path: root/lib/private/Preview
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Add backgroundcleanup jobRoeland Jago Douma2018-05-141-0/+91
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* move log constants to ILoggerArthur Schiwon2018-04-263-3/+8
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Remove unneeded semicolon and parenthesesMorris Jobke2018-01-261-1/+1
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Properly log the full exception instead of only the messageMorris Jobke2018-01-233-3/+13
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* If the preview is size 0 it is invalidRoeland Jago Douma2018-01-221-3/+13
| | | | | | | | | * delete it * throw a NotFound Exception - This should a proper 404 to the user - Next time it is then regenerated Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Improve OC_Image code to not guess the type of input, but actually request ↵Morris Jobke2018-01-181-2/+3
| | | | | | | | the specific methods to be called Followup to #7836 Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Fix float/integer handling in image APIMorris Jobke2018-01-172-4/+6
| | | | | | | * IImage::crop/preciseResize now have type hinting for integers * found while testing strict typing for PHP 7+ Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Merge pull request #7731 from nextcloud/preview_size_incJan-Christoph Borchardt2018-01-091-2/+2
|\ | | | | Max preview size to 4096x4096
| * Max preview size to 4096x4096Roeland Jago Douma2018-01-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | With HiDPI screens. And even normal HD screens you want more detail from your pictures. Or the ability to somewhat zoom on you previews. For this we need somewhat larger previews. Moving the default to 4096x4096 is a step up. Users that want the old behavior can still set the values in config.php Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | Only return 1 typeRoeland Jago Douma2018-01-071-5/+17
| | | | | | | | | | | | | | Throw proper exception if we can't get the mimetype for a preview. Catch it later on so we can just return a not found for the preview. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | Don't lie about the preview mimetypeRoeland Jago Douma2018-01-071-7/+29
|/ | | | | | | | | | | | | | For legacy reasons we stored all the previews with a png extention. However we did not put png data in them all the time. This caused the preview endpoints to always report that a preview is a png file. Which was a lie. Since we abstract away from the storage etc in the previewmanager. There is no need anymore to store them as .png files and instead we can use the actual file extention. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Properly detect if fopen fails for txt previewsRoeland Jago Douma2017-12-111-0/+5
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Change @georgehrke's emailMorris Jobke2017-11-066-6/+6
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Update license headersMorris Jobke2017-11-065-4/+6
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Allow requesting the max previewRoeland Jago Douma2017-09-251-0/+6
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Use IConfig instead of static OCP\ConfigMorris Jobke2017-07-271-1/+1
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Merge pull request #5836 from nextcloud/preview_updateLukas Reschke2017-07-251-1/+7
|\ | | | | Empty search no longer works
| * Empty search no longer worksRoeland Jago Douma2017-07-241-1/+7
| | | | | | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | More phpstorm inspection fixesRoeland Jago Douma2017-07-243-3/+3
|/ | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add PHPDocMorris Jobke2017-05-021-0/+2
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* better handling of preview generation errorsRobin Appelman2017-05-021-0/+5
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Some code cleanupRoeland Jago Douma2017-03-191-12/+21
| | | | | | As suggested by the inspector Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Don't generate max preview twiceRoeland Jago Douma2017-03-191-0/+5
| | | | | | | | If you request a preview of X by Y. And after calculating X and Y are equal to maxWidth and maxHeight then there is no reason to create a preview of that size. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* MP3 without cover don't get a previewRoeland Jago Douma2017-03-101-19/+1
| | | | | | | | | | * Fixes #2739 It tries to create an image from an SVG file. Which we don't support. So this fails and prints an log line. Then we fall back anyways to the 404 and fetch the default icon. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix previews for federated sharesRoeland Jago Douma2016-11-241-1/+2
| | | | | | | The owner of a federated file is the federated user. For which we obviously can't setup a view. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Dispatch event on preview requestRoeland Jago Douma2016-11-101-1/+18
| | | | | | Fixes: #73 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Added genertor helper & testsRoeland Jago Douma2016-11-032-35/+100
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Moved over files_versionsRoeland Jago Douma2016-11-031-5/+10
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Move Ipreview to more of DI thingyRoeland Jago Douma2016-11-031-22/+15
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix name conflictRoeland Jago Douma2016-11-031-3/+3
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Move fileRoeland Jago Douma2016-11-031-0/+366
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Watch for file modification/deletionRoeland Jago Douma2016-11-032-0/+170
| | | | | | | * Only connect the watcher once the instance is properly setup else AppData fails hard. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Update with robinJoas Schilling2016-07-213-3/+3
|
* Fix othersJoas Schilling2016-07-2125-44/+70
|
* remove png references in coreHendrik Leppelsack2016-07-011-1/+1
|