From 8ed27d2ce0477f40a27cdc335361b0d5654a7e09 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 13 Mar 2015 10:10:11 +0100 Subject: Create an interface for OC_Image and OCP\Image for the public API --- lib/public/iavatar.php | 4 +- lib/public/iimage.php | 193 +++++++++++++++++++++++++++++++++++++++ lib/public/ipreview.php | 2 +- lib/public/preview/iprovider.php | 4 +- 4 files changed, 197 insertions(+), 6 deletions(-) create mode 100644 lib/public/iimage.php (limited to 'lib/public') diff --git a/lib/public/iavatar.php b/lib/public/iavatar.php index 8f432c23fb8..984fe1075b4 100644 --- a/lib/public/iavatar.php +++ b/lib/public/iavatar.php @@ -16,7 +16,7 @@ interface IAvatar { /** * get the users avatar * @param int $size size in px of the avatar, avatars are square, defaults to 64 - * @return boolean|\OC_Image containing the avatar or false if there's no image + * @return boolean|\OCP\IImage containing the avatar or false if there's no image */ function get($size = 64); @@ -29,7 +29,7 @@ interface IAvatar { /** * sets the users avatar - * @param \OC_Image|resource|string $data OC_Image, imagedata or path to set a new avatar + * @param \OCP\IImage|resource|string $data An image object, imagedata or path to set a new avatar * @throws \Exception if the provided file is not a jpg or png image * @throws \Exception if the provided image is not valid * @throws \OC\NotSquareException if the image is not square diff --git a/lib/public/iimage.php b/lib/public/iimage.php new file mode 100644 index 00000000000..6ba7a501eb8 --- /dev/null +++ b/lib/public/iimage.php @@ -0,0 +1,193 @@ +