aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/legacy/OC_Image.php
Commit message (Collapse)AuthorAgeFilesLines
* fix(previews): Stop returning true when getimagesize() failsJosh Richards2024-07-151-3/+3
| | | | Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
* chore: Add SPDX headerAndy Scherzinger2024-05-241-41/+3
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* fix(OC_Image): Set correct return type for exif_imagetype stubprovokateurin2024-05-061-1/+1
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* fix: Drop workarounds for unsupported obsolete PHP versionsCôme Chilliet2024-04-221-2/+1
| | | | | | Also improved error handling in Installer.php to be type safe. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix: Fix typing issues related to resource migrationCôme Chilliet2024-04-091-47/+29
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix: Fix new psalm errors from updateCôme Chilliet2024-04-081-1/+1
| | | | | | | Not sure about the SimpleContainer modification, let’s see what CI says about that. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix: Apply new coding standard to all filesCôme Chilliet2024-04-021-2/+2
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix(preview): webp preview formatRichard Steinmetz2024-03-261-0/+26
| | | | Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
* Silent imagecreatefromstring() errorsGit'Fellow2023-06-301-1/+1
| | | Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
* fix OC_Image: Prevent E_WARNING from getimagesize*Marcel Klehr2023-03-161-2/+2
| | | | Signed-off-by: Marcel Klehr <mklehr@gmx.net>
* composer run cs:fixCôme Chilliet2023-01-201-25/+24
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* increase preview_max_memory and make it easier to debugSimon L2022-12-221-3/+3
| | | | Signed-off-by: Simon L <szaimen@e.mail.de>
* Allow empty mimeTypeJ0WI2022-12-041-8/+7
| | | | Signed-off-by: J0WI <J0WI@users.noreply.github.com>
* Add type hintsJ0WI2022-12-041-49/+45
| | | | Signed-off-by: J0WI <J0WI@users.noreply.github.com>
* Fix redundant conditionJ0WI2022-12-041-1/+1
| | | | Signed-off-by: J0WI <J0WI@users.noreply.github.com>
* Remove obsolete GD function overwritesJ0WI2022-12-041-281/+1
| | | | Signed-off-by: J0WI <J0WI@users.noreply.github.com>
* getAppValue expects stringJohn Molakvoæ2022-11-171-1/+1
| | | | Co-authored-by: Pytal <24800714+Pytal@users.noreply.github.com> Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
* Default Jpeg quality to 80Git'Fellow2022-11-161-1/+1
| | | | | | See https://sirv.com/help/articles/jpeg-quality-comparison/ Almost 50% of file size (compared to 90) and no visual differences. Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
* Interlace all output JPEGVarun Patil2022-10-251-0/+4
| | | | | | Progressive images are both smaller and faster to load. Signed-off-by: Varun Patil <radialapps@gmail.com>
* Move Gd failed operations to debug levelGit'Fellow2022-05-251-20/+18
| | | Instead of error
* Prevent loading images that would require too much memory.Joachim Bauch2022-01-111-1/+102
| | | | | | | | | | | | | For most image formats, the header specifies the width/height. PHP allocates an image object from that size, even if the actual image data is much smaller. This image object size is not limited by the limit configured in PHP. The memory limit can be configured through "config.php" setting "preview_max_memory" and defaults to 128 MBytes which should be enough for most images without filling up all memory. Signed-off-by: Joachim Bauch <bauch@struktur.de>
* Avoid assignment in if clauseCôme Chilliet2021-12-061-8/+12
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix typing problems in OC_ImageCôme Chilliet2021-12-061-2/+10
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Avoid calling image* methods on booleanCôme Chilliet2021-12-061-14/+27
| | | | | | | This avoids fatal errors on PHP>=8, and warnings on older versions. Log should also be clearer. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix imagecreatetruecolor() errorszaimen2021-11-101-0/+4
| | | | Signed-off-by: szaimen <szaimen@e.mail.de>
* Fix resource usages in OC_ImageCôme Chilliet2021-10-281-17/+17
| | | | | | This makes sure using resource or GdImage (PHP>=8) behaves the same. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Merge pull request #28473 from nextcloud/fix-file-get-contentsChristoph Wurst2021-08-251-1/+1
|\ | | | | Fix path of `file_get_contents`
| * Avoid usage of Nextcloud API, use PHP functionacsfer2021-08-181-1/+1
| |
| * Fix path of `file_get_contents`acsfer2021-08-171-1/+1
| | | | | | | | | | Try to fix #28370 and #27441 Avoid pre-pends the `$path` to the user's own storage.
* | Remove unused methodDaniel Kesselberg2021-08-181-10/+0
| | | | | | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* | Fix #20913: Check image resource before attempting to preserve alphaSimon Spannagel2021-08-181-6/+14
|/ | | | Signed-off-by: Simon Spannagel <simonspa@kth.se>
* Update php licensesJohn Molakvoæ (skjnldsv)2021-06-041-1/+0
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Add support for webpRoeland Jago Douma2021-01-191-1/+8
| | | | | | | | | 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>
* 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>
* | GD imagesRoeland Jago Douma2020-12-071-2/+15
|/ | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Change 0 to null to properly encode image to BMP if the first pixel is blackMorris Jobke2020-09-101-1/+1
| | | | | | Ref #22288 Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Cast float/char to int to avoid invalid scalar argument warningMorris Jobke2020-08-181-2/+2
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Fix OC_Image new resize functionsRoeland Jago Douma2020-05-021-0/+9
| | | | | | | Else the wrong mimetype might be set. Resulting in continious regeneration of previews when browsing. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add visibility to all properties and move static keywordChristoph Wurst2020-04-101-1/+0
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #20422 from ↵Christoph Wurst2020-04-101-1/+1
|\ | | | | | | | | nextcloud/techdebt/format-control-structs-classes-methods Format control structures, classes, methods and function
| * Format control structures, classes, methods and functionChristoph Wurst2020-04-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-8/+94
|\ \ | |/ |/| optimize batch generation of previews
| * optimize batch generation of previewsRobin Appelman2020-04-091-8/+94
| | | | | | | | | | | | | | | | | | | | 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>
* | Use elseif instead of else ifChristoph Wurst2020-04-101-2/+2
|/ | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Move legacy classes from PSR0 to PSR4Christoph Wurst2020-04-071-0/+1194
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>