aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Preview
Commit message (Collapse)AuthorAgeFilesLines
* chore(deps): Update nextcloud/coding-standard to v1.3.1provokateurin2024-09-193-4/+4
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* Merge pull request #47852 from nextcloud/sharding-code-fixesJohn Molakvoæ2024-09-161-1/+0
|\
| * fix: misc code fixes around db shardingsharding-code-fixesRobin Appelman2024-09-091-1/+0
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | Merge pull request #47865 from ↵Côme Chilliet2024-09-131-0/+1
|\ \ | | | | | | | | | | | | nextcloud/admin_audit/enh/move-to-event-listeners-v2 Move admin_audit to proper event listeners v2
| * | feat: Add mimetype into BeforePreviewFetchedEvent eventThomas Citharel2024-09-101-0/+1
| |/ | | | | | | Signed-off-by: Thomas Citharel <tcit@tcit.fr>
* / fix(preview): gracefully handle file not being opened in ProviderV2Richard Steinmetz2024-09-101-0/+3
|/ | | | Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
* fix: implement sharding compatible cleanup for various bitsRobin Appelman2024-08-281-0/+57
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* style: update codestyle for coding-standard 1.2.3Daniel Kesselberg2024-08-257-12/+12
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* feat(preview): move previews for imaginary pdf to own class ImaginaryPDFernolf2024-07-252-1/+15
| | | | | | Signed-off-by: ernolf <raphael.gradenwitz@googlemail.com> Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* fix: explicitly filter for storageid in preview cleanup jobRobin Appelman2024-07-231-0/+2
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* feat: log file id and path when extracting the mp3 cover failsDaniel Kesselberg2024-07-041-4/+4
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* chore: Add SPDX headerAndy Scherzinger2024-05-2443-873/+139
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* fix: Extend SVG reference checkJoas Schilling2024-05-161-1/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Merge pull request #44710 from nextcloud/pulsejet/imagick-check-typeJoas Schilling2024-05-1511-10/+106
|\ | | | | fix(preview): check mime type before processing with Imagick
| * fix(preview): check mime type before processing with ImagickVarun Patil2024-04-0811-10/+106
| | | | | | | | Signed-off-by: Varun Patil <varunpatil@ucla.edu>
* | fix: Fix newly spotted psalm issues, add exhaustive typed magic properties ↵Côme Chilliet2024-04-301-1/+1
|/ | | | | | for LDAP classes Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix: Apply new coding standard to all filesCôme Chilliet2024-04-022-2/+2
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Lower failed movie preview to infoGit'Fellow2024-02-031-1/+1
| | | Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
* Merge pull request #41067 from Murena-SAS/preview-folder-deletesArthur Schiwon2024-01-181-0/+3
|\ | | | | Fix for previews not being generated sometimes
| * Check if the node has a null ID before deleting in preview watcherAkhil2023-10-231-0/+3
| | | | | | | | Signed-off-by: Akhil <akhil@e.email>
* | chore: apply changes from Nextcloud coding standards 1.1.1Joas Schilling2023-11-233-7/+7
| | | | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com> Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
* | Merge pull request #41395 from nextcloud/hello-emfChristoph Wurst2023-11-162-25/+68
|\ \ | | | | | | feat: add preview provider for emf files based on office
| * | fix: use png as preview right awayDaniel Kesselberg2023-11-131-16/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The initial office preview implementation converted an office document with LibreOffice to PDF, used ImageMagick to extract the first page as JPEG, and passed it OC_Image. https://github.com/nextcloud/server/pull/10198 changed the implementation to use PNG rather than PDF. OC_Image can use a PNG as a preview right away, so the ImageMagick step is unnecessary. The registration code was updated to not ask ImageMagick if PDF is supported, as PDFs are no longer used to create office document previews. Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
| * | feat: allow multiple libreoffice invocationsDaniel Kesselberg2023-11-131-11/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LibreOffice only allows one invocation per user profile.[^1] The office provider set the user profile to /tmp/owncloud-instanceid and therefore only one invocation per instance is allowed. This was introduced a while ago, yet it's unclear if this was intentionally or just a side effect.[^2] The limitation on one invocation leads to the situation that the preview generation only works for a couple of files if you upload a whole folder of emf or word files. This commit removes the limitation by using a new user profile for each preview. That's done by using instance id plus file id as postfix for getTemporaryFolder. This has some drawbacks: - Overload protection: If you upload 100 emf files, you may end up with 100 LibreOffice invocations. Though, you can use preview_concurrency_new to limit the number of previews that can be generated concurrently when php-sysvsem is available. - New profile: I assume it takes a few bits to generate a fresh LibreOffice user profile. It appears that there is no way to ask LibreOffice to not create a profile and just work with the defaults. The profile will be cleaned after use by our temp manager. - Remove the configuration option preview_office_cl_parameters: This is not strictly necessary yet, but if you set the configuration option, the generated path for the user profile is also missing. The configuration option is not well documented (e.g., it's unclear that the last option needs to be --outdir) and actually, there should be no reason to change it after all. [^1]: https://wiki.documentfoundation.org/UserProfile [^2]: https://github.com/owncloud/core/pull/9784 Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
| * | feat: add preview provider for emf files based on officeDaniel Kesselberg2023-11-131-0/+33
| | | | | | | | | | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* | | Us strpos() onlyGit'Fellow2023-11-151-9/+3
| | | | | | | | | Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
* | | Check for open_basedir before reading /procGit'Fellow2023-11-151-2/+14
|/ / | | | | Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
* | address reviewSimon L2023-11-031-4/+4
| | | | | | | | Signed-off-by: Simon L <szaimen@e.mail.de>
* | fix semaphore guardingSimon L2023-11-031-1/+1
| | | | | | | | Signed-off-by: Simon L <szaimen@e.mail.de>
* | Use \Throwable insteadGit'Fellow2023-11-011-1/+1
| | | | | | Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
* | Catch Imaginary processing errorsGit'Fellow2023-11-011-1/+1
| | | | | | Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
* | Don't pass invalid streams to ImaginaryGit'Fellow2023-10-251-0/+3
|/ | | | | | | | | | | | Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> Update Imaginary.php Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> Update Imaginary.php Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
* also remove functionDaniel Hansson2023-10-021-19/+0
| | | Signed-off-by: Daniel Hansson <mailto@danielhansson.nu>
* Generate all preview sizes for ImaginaryDaniel Hansson2023-09-301-17/+0
| | | | | | | | | | | A follow up on https://github.com/nextcloud/server/pull/40670 Based on discussions here: https://github.com/nextcloud/server/issues/38911#issuecomment-1741819188 This fixes the case were not all previews are generated, for example in the activity view: https://github.com/nextcloud/server/issues/38911#issuecomment-1738886106 Signed-off-by: Daniel Hansson <mailto@danielhansson.nu>
* feat: Imaginary WebP supportJanisPlayer2023-09-022-1/+21
| | | | Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
* feat(files): add uploaderJohn Molakvoæ2023-09-011-1/+1
| | | | Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
* feat: redirect to the mime icon if no preview availableJohn Molakvoæ2023-08-171-0/+98
| | | | Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
* log imaginary errors as info to not spam the server logsSimon L2023-08-091-2/+2
| | | | Signed-off-by: Simon L <szaimen@e.mail.de>
* fix!: Remove legacy event dispatching Symfony's GenericEventJoas Schilling2023-07-271-10/+0
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* chore: Replace \OC::$server->query with \OCP\Server::get in /libChristoph Wurst2023-07-061-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* feat: replace id3parser with mp3infoDaniel Kesselberg2023-06-281-11/+6
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* feat: add width, height, crop and mode to BeforePreviewFetchedEventDaniel Kesselberg2023-06-231-2/+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>
* Merge pull request #38261 from fsamapoor/replace_strpos_calls_in_lib_privateRobin Appelman2023-06-011-1/+1
|\ | | | | Refactors "strpos" calls in lib/private to improve code readability.
| * Refactors "strpos" calls in lib/private to improve code readability.Faraz Samapoor2023-05-151-1/+1
| | | | | | | | Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
* | fix: catch errors in id3parser libraryDaniel Kesselberg2023-05-281-2/+13
| | | | | | | | | | | | | | | | We use a forked version of getID3 to read embedded images from mp3 files to use them as previews. If the library is unable to extract a image or fails on something different we should handle it properly. Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* | Allow to specify an imaginary keyJanisPlayer2023-05-221-1/+2
| | | | | | | | Signed-off-by: JanisPlayer <54918417+JanisPlayer@users.noreply.github.com>
* | Merge pull request #36692 from ↵Simon L2023-05-171-0/+4
|\ \ | |/ |/| | | | | nextcloud/throw-exception-to-avoid-division-by-zero fix(preview-generator): Throw exception before dividing by zero when generating previews
| * fix(preview-generator): Throw exception before dividing by zero when ↵Thomas Citharel2023-02-131-0/+4
| | | | | | | | | | | | | | | | | | generating previews If the maximum preview generated gives some kind of invalid IImage, it's dimentions and filename can be set to zero. And then later we do a division by zero to keep the aspect ratio of the previews. Signed-off-by: Thomas Citharel <tcit@tcit.fr>
* | Fix typos in lib/public subdirectorySimon L2023-05-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Found via `codespell -q 3 -S l10n -L jus ./lib/public` Signed-off-by: luz paz <luzpaz@github.com> Update lib/public/Accounts/IAccount.php Signed-off-by: luz paz <luzpaz@github.com> Signed-off-by: Simon L <szaimen@e.mail.de> Co-Authored-By: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
* | Merge pull request #37148 from nextcloud/enh/noid/increase-imaginary-timeoutsSimon L2023-05-041-0/+2
|\ \ | | | | | | increase imaginary timeouts as for big files the processing could take very long