summaryrefslogtreecommitdiffstats
path: root/lib/private/Preview
Commit message (Collapse)AuthorAgeFilesLines
* Use Image class from public APIChristopher Ng2022-06-0211-11/+11
| | | | Signed-off-by: Christopher Ng <chrng8@gmail.com>
* Merge pull request #32410 from nextcloud/bugfix/noid/imaginary-exceptionJohn Molakvoæ2022-05-201-2/+7
|\
| * Add explicit return if getSmallImagePreview failsJulius Härtl2022-05-191-2/+7
| | | | | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* | Fix crop conditionCarl Schwan2022-05-191-4/+11
| | | | | | | | | | | | | | | | Make sure that when fetching the image from the cache we don't accidentally fetch the cropped image just because it also start with 256-256 Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* | Fix cropped image generated when not askedCarl Schwan2022-05-171-1/+2
|/ | | | | | | The $crop parameter was not propagated to the imaginary pipeline and instead it used the smartcrop algorithm always Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Merge pull request #32315 from ↵John Molakvoæ2022-05-101-2/+10
|\ | | | | | | nextcloud/fix/noid/preview-duplicate-folder-creation
| * Fix preview generator trying to recreate an existing folderRichard Steinmetz2022-05-091-2/+10
| | | | | | | | Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
* | Set loglevel for IMagick Thumbnail error to infoAlexander F2022-05-091-1/+1
|/ | | | | | Issue #32263 Signed-off-by: Alexander Fleischer <Alexander.Fleischer@tu-ilmenau.de>
* Migrate more classes of lib/private to LoggerInterfaceCôme Chilliet2022-04-262-6/+6
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Generate small preview straight away if Imaginary is enabledJohn Molakvoæ2022-04-061-2/+7
| | | | Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
* Fix imaginary with rotated exif imagesCarl Schwan2022-04-041-8/+16
| | | | | | | | | | | | | Now do the operation in two steps: 1. Rotate the image according the exif data 2. Do the actual operation This should only have a performance impact on image with exif rotation data to do the rotation. For all the other images the autorotate steps should be almost instant. Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Merge pull request #24166 from nextcloud/imaginary-prototypeCarl Schwan2022-03-183-3/+222
|\ | | | | Send images to Imaginary docker to generate previews
| * Send images to imaginary docker to generate previewsVincent Petry2022-03-173-3/+222
| | | | | | | | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu> Co-Authored-by: Vincent Petry <vincent@nextcloud.com>
* | Ignore errors when searching for bundled previewCôme Chilliet2022-02-281-1/+1
| | | | | | | | | | | | | | When an odt file is xml and not zip, it would throw a ValueError. It will now just ignore this file and return null for the preview. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* | Fix tmp file cleaning for bundled previewsCôme Chilliet2022-02-242-2/+4
| | | | | | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* | Fix typing in OC\Preview\MovieCôme Chilliet2022-02-241-10/+3
| | | | | | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* | Fix typing in OC\PreviewCôme Chilliet2022-02-247-25/+51
|/ | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* reduce 'Movie preview generation failed Output' log errorsUmbrellaCodr2022-02-031-2/+4
| | | | | | | | | | for movies under 5 seconds Signed-off-by: UmbrellaCodr <umbrella@biohazard.cc> Update lib/private/Preview/Movie.php Co-authored-by: Simon L. <szaimen@e.mail.de>
* Check style updateCarl Schwan2022-01-132-3/+3
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Merge pull request #28610 from nextcloud/enh/preview-cleanup-queryJulius Härtl2021-12-282-0/+5
|\
| * Use storage filter when fetching previews to cleanupJulius Härtl2021-08-262-0/+5
| | | | | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* | Fix resource usages in OC_ImageCôme Chilliet2021-10-283-3/+3
| | | | | | | | | | | | This makes sure using resource or GdImage (PHP>=8) behaves the same. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* | Use findBinaryPath for previewsJ0WI2021-10-235-37/+74
| | | | | | | | Signed-off-by: J0WI <J0WI@users.noreply.github.com>
* | Fall back to full file for video previewsVincent Petry2021-09-182-9/+29
|/ | | | | | | If the first 5 MB are not enough to grab a useful frame for the thumbnail preview, fall back to reading the full file. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Properly log errors in Movie previews generationJohn Molakvoæ (skjnldsv)2021-08-192-2/+8
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Update php licensesJohn Molakvoæ (skjnldsv)2021-06-0439-53/+20
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Use correct getSystemValue typeJ0WI2021-04-122-3/+3
| | | | Signed-off-by: J0WI <J0WI@users.noreply.github.com>
* 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>