diff options
author | provokateurin <kate@provokateurin.de> | 2024-09-02 10:15:10 +0200 |
---|---|---|
committer | provokateurin <kate@provokateurin.de> | 2024-09-02 14:57:17 +0200 |
commit | 031166c1771cff50f4069098031a94a8e8da35c5 (patch) | |
tree | e1579022c2330a9b206e26247aac1fa86302d7de /lib | |
parent | 3973a8f722c4acf5da82a611ee50f04e19627727 (diff) | |
download | nextcloud-server-031166c1771cff50f4069098031a94a8e8da35c5.tar.gz nextcloud-server-031166c1771cff50f4069098031a94a8e8da35c5.zip |
fix(OCP): Fix Image interface
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Image.php | 4 | ||||
-rw-r--r-- | lib/private/StreamImage.php | 8 | ||||
-rw-r--r-- | lib/public/IImage.php | 20 | ||||
-rw-r--r-- | lib/public/Image.php | 8 |
4 files changed, 36 insertions, 4 deletions
diff --git a/lib/private/Image.php b/lib/private/Image.php index 39624612560..3dd0bc49662 100644 --- a/lib/private/Image.php +++ b/lib/private/Image.php @@ -779,9 +779,7 @@ class Image implements IImage { } /** - * Loads an image from a string of data. - * - * @param string $str A string of image data as read from a file. + * @inheritDoc */ public function loadFromData(string $str): GdImage|false { if (!$this->checkImageDataSize($str)) { diff --git a/lib/private/StreamImage.php b/lib/private/StreamImage.php index 9290bf38b0f..34fe590efbd 100644 --- a/lib/private/StreamImage.php +++ b/lib/private/StreamImage.php @@ -133,4 +133,12 @@ class StreamImage implements IStreamImage { public function resizeCopy(int $maxSize): IImage { throw new \BadMethodCallException('Not implemented'); } + + public function loadFromData(string $str): \GdImage|false { + throw new \BadMethodCallException('Not implemented'); + } + + public function readExif(string $data): void { + throw new \BadMethodCallException('Not implemented'); + } } diff --git a/lib/public/IImage.php b/lib/public/IImage.php index b201754536d..7ba08c889da 100644 --- a/lib/public/IImage.php +++ b/lib/public/IImage.php @@ -8,6 +8,8 @@ declare(strict_types=1); */ namespace OCP; +use GdImage; + /** * Class for basic image manipulation * @since 8.1.0 @@ -202,4 +204,22 @@ interface IImage { * @since 19.0.0 */ public function resizeCopy(int $maxSize): IImage; + + /** + * Loads an image from a string of data. + * + * @param string $str A string of image data as read from a file. + * + * @since 31.0.0 + */ + public function loadFromData(string $str): GdImage|false; + + /** + * Reads the EXIF data for an image. + * + * @param string $data EXIF data + * + * @since 31.0.0 + */ + public function readExif(string $data): void; } diff --git a/lib/public/Image.php b/lib/public/Image.php index a9aab778207..84d07d6a4b4 100644 --- a/lib/public/Image.php +++ b/lib/public/Image.php @@ -14,5 +14,11 @@ namespace OCP; * This class provides functions to handle images * @since 6.0.0 */ -class Image extends \OC\Image { +class Image extends \OC\Image implements \OCP\IImage { + /** + * @since 31.0.0 + */ + public function __construct() { + parent::__construct(); + } } |