mirror of
https://github.com/nextcloud/server.git
synced 2025-03-15 00:43:23 +00:00
fix(OCP): Fix Image interface
Signed-off-by: provokateurin <kate@provokateurin.de>
This commit is contained in:
parent
3973a8f722
commit
031166c177
4 changed files with 36 additions and 4 deletions
lib
|
@ -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)) {
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue