Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2020-02-16 04:34:09 +0300
committerRobin Appelman <robin@icewind.nl>2020-04-09 13:50:59 +0300
commit7d386872e5f4c5530a936465f71b4e1ea85a565e (patch)
tree78f98df7273c85953350a0365adbdb2e83613e8d /lib/public/IImage.php
parent5cd12cd7c39c2ea156ab35266c9359cdd0f4c070 (diff)
optimize batch generation of previews
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>
Diffstat (limited to 'lib/public/IImage.php')
-rw-r--r--lib/public/IImage.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/public/IImage.php b/lib/public/IImage.php
index 67db6b097ef..6e6c28609d8 100644
--- a/lib/public/IImage.php
+++ b/lib/public/IImage.php
@@ -190,4 +190,43 @@ interface IImage {
* @since 8.1.0
*/
public function scaleDownToFit($maxWidth, $maxHeight);
+
+ /**
+ * create a copy of this image
+ *
+ * @return IImage
+ * @since 19.0.0
+ */
+ public function copy(): IImage;
+
+ /**
+ * create a new cropped copy of this image
+ *
+ * @param int $x Horizontal position
+ * @param int $y Vertical position
+ * @param int $w Width
+ * @param int $h Height
+ * @return IImage
+ * @since 19.0.0
+ */
+ public function cropCopy(int $x, int $y, int $w, int $h): IImage;
+
+ /**
+ * create a new resized copy of this image
+ *
+ * @param int $width
+ * @param int $height
+ * @return IImage
+ * @since 19.0.0
+ */
+ public function preciseResizeCopy(int $width, int $height): IImage;
+
+ /**
+ * create a new resized copy of this image
+ *
+ * @param integer $maxSize The maximum size of either the width or height.
+ * @return IImage
+ * @since 19.0.0
+ */
+ public function resizeCopy(int $maxSize): IImage;
}