fix(OCP): Fix Image interface

Signed-off-by: provokateurin <kate@provokateurin.de>
pull/47676/head
provokateurin 2 years ago
parent 3973a8f722
commit 031166c177
No known key found for this signature in database
  1. 4
      lib/private/Image.php
  2. 8
      lib/private/StreamImage.php
  3. 20
      lib/public/IImage.php
  4. 8
      lib/public/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)) {

@ -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…
Cancel
Save