1: <?php
2: /*
3: You may not change or alter any portion of this comment or credits
4: of supporting developers from this source code or any supporting source code
5: which is considered copyrighted (c) material of the original comment or credit authors.
6:
7: This program is distributed in the hope that it will be useful,
8: but WITHOUT ANY WARRANTY; without even the implied warranty of
9: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10: */
11:
12: namespace Xoops\Core\Service\Contract;
13:
14: use Xoops\Core\Service\Response;
15:
16: /**
17: * Thumbnail service interface
18: *
19: * @category Xoops\Core\Service\Contract\ThumbnailInterface
20: * @package Xoops\Core
21: * @author Richard Griffith <richard@geekwright.com>
22: * @copyright 2014 The XOOPS Project https://github.com/XOOPS/XoopsCore
23: * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
24: * @version Release: 1.0
25: * @link http://xoops.org
26: * @since 2.6.0
27: */
28: interface ThumbnailInterface
29: {
30: const MODE = \Xoops\Core\Service\Manager::MODE_EXCLUSIVE;
31:
32: /**
33: * getImgUrl - get URL to a thumbnail of the supplied image
34: *
35: * @param Response $response \Xoops\Core\Service\Response object
36: * @param string $imgPath path to image to be thumbed
37: * @param integer $width maximum width of thumbnail in pixels, 0 to use default
38: * @param integer $height maximum height of thumbnail in pixels, 0 to use default
39: *
40: * @return void - response->value set to URL string
41: */
42: public function getImgUrl(Response $response, $imgPath, $width = 0, $height = 0);
43:
44: /**
45: * getImgTag - get a full HTML img tag to display a thumbnail of the supplied image
46: *
47: * @param Response $response \Xoops\Core\Service\Response object
48: * @param string $imgPath path to image to be thumbed
49: * @param integer $width maximum width of thumbnail in pixels, 0 to use default
50: * @param integer $height maximum height of thumbnail in pixels, 0 to use default
51: * @param array $attributes array of attribute name => value pairs for img tag
52: *
53: * @return void - response->value set to image tag
54: */
55: public function getImgTag(
56: Response $response,
57: $imgPath,
58: $width = 0,
59: $height = 0,
60: $attributes = array()
61: );
62: }
63: