aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Preview/GeneratorTest.php
Commit message (Collapse)AuthorAgeFilesLines
* refactor: Add void return type to PHPUnit test methodsChristoph Wurst2024-09-151-7/+7
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* feat: Add mimetype into BeforePreviewFetchedEvent eventThomas Citharel2024-09-101-6/+6
| | | | Signed-off-by: Thomas Citharel <tcit@tcit.fr>
* fix: Remove all references to OC_ImageCôme Chilliet2024-08-291-2/+3
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* chore: Add SPDX headerAndy Scherzinger2024-05-131-19/+2
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* fix!: Remove legacy event dispatching Symfony's GenericEventJoas Schilling2023-07-271-79/+0
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* feat: add width, height, crop and mode to BeforePreviewFetchedEventDaniel Kesselberg2023-06-231-6/+6
| | | | | | | | | | | | | | user_usage_report keeps a counter for files read. The app uses - OC_Filesystem::read hook - Event listener (the legacy one) for IPreview::EVENT Request for previews do not trigger the hook, hence the additional event listener. The thumbnails for a list or grid view should not count, so we need the width and height. Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* adapt test to new workflowGlandos2023-04-171-12/+7
| | | | | | | getDirectoryListing should return all files getFile is not called anymore Signed-off-by: Glandos <bugs-github@antipoul.fr>
* composer run cs:fixCôme Chilliet2023-01-201-1/+0
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Limit-number-of-concurrent-preview-generationsszaimen2022-11-051-2/+7
| | | | | Signed-off-by: Bowen Ding <dbw9580@live.com> Signed-off-by: szaimen <szaimen@e.mail.de>
* Emit typed event when preview is requestedJulius Härtl2022-10-271-8/+39
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Add typing to SimpleFSCarl Schwan2022-07-141-0/+8
| | | | | | - Fix putContent sometimes return a bool and sometimes nothing Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Fix existing test and add a specific one for the new caseMorris Jobke2020-08-131-9/+72
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to ↵Morris Jobke2020-08-121-5/+5
| | | | | | \PHPUnit\Framework\MockObject\MockObject Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* fix memory leak caused by not destroying image in Preview/Generate.phpElijah Martin-Merrill2020-07-271-3/+2
| | | | Signed-off-by: Elijah Martin-Merrill <elijah@nyp-itsours.com>
* Add visibility to all properties and move static keywordChristoph Wurst2020-04-101-3/+3
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #19495 from nextcloud/preview-generate-batchRoeland Jago Douma2020-04-101-14/+23
|\ | | | | optimize batch generation of previews
| * fix preview generation testsRobin Appelman2020-04-101-14/+23
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | Use elseif instead of else ifChristoph Wurst2020-04-101-5/+5
| | | | | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | Unify function spacing to PSR2 recommendationChristoph Wurst2020-04-091-8/+8
|/ | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #20170 from nextcloud/techdebt/remove-unused-importsChristoph Wurst2020-03-271-1/+0
|\ | | | | Remove unused imports
| * Remove unused importsChristoph Wurst2020-03-251-1/+0
| | | | | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | Use the shorter phpunit syntax for mocked return valuesChristoph Wurst2020-03-251-8/+8
|/ | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Mode to modern phpunitRoeland Jago Douma2019-11-271-1/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Make phpunit8 compatibleRoeland Jago Douma2019-11-271-1/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Some php-cs fixesRoeland Jago Douma2019-11-221-0/+1
| | | | | | | | | | | * 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>
* Add new Provider interface for preview providersRobin Appelman2019-06-171-3/+4
| | | | | | | | | 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>
* Only generate previews in powers of 4 and set minRoeland Jago Douma2018-10-311-8/+14
| | | | | | | | | | | | | | | 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>
* Check if a preview provider is available before using itRoeland Jago Douma2018-08-171-2/+12
| | | | | | | | 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>
* Make sure the file is readable before attempting to create a previewRoeland Jago Douma2018-05-301-0/+20
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Don't lie about the preview mimetypeRoeland Jago Douma2018-01-071-0/+8
| | | | | | | | | | | | | | 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>
* fix preview testsRobin Appelman2017-05-021-0/+3
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Fix testsRoeland Jago Douma2017-03-191-1/+5
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Dispatch event on preview requestRoeland Jago Douma2016-11-101-1/+67
| | | | | | Fixes: #73 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Added genertor helper & testsRoeland Jago Douma2016-11-031-0/+338
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>