diff options
author | Robin Appelman <robin@icewind.nl> | 2020-02-16 02:34:09 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2020-04-09 12:50:59 +0200 |
commit | 7d386872e5f4c5530a936465f71b4e1ea85a565e (patch) | |
tree | 78f98df7273c85953350a0365adbdb2e83613e8d /lib/public | |
parent | 5cd12cd7c39c2ea156ab35266c9359cdd0f4c070 (diff) | |
download | nextcloud-server-7d386872e5f4c5530a936465f71b4e1ea85a565e.tar.gz nextcloud-server-7d386872e5f4c5530a936465f71b4e1ea85a565e.zip |
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')
-rw-r--r-- | lib/public/IImage.php | 39 |
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; } |