1 <?php
2 /**
3 * @author Gasper Kozak
4 * @copyright 2007-2011
5
6 This file is part of WideImage.
7
8 WideImage is free software; you can redistribute it and/or modify
9 it under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
12
13 WideImage is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public License
19 along with WideImage; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
22 * @package Internal/Mappers
23 **/
24
25 /**
26 * Mapper class for GD files
27 *
28 * @package Internal/Mappers
29 */
30 class WideImage_Mapper_GD
31 {
32 function load($uri)
33 {
34 return @imagecreatefromgd($uri);
35 }
36
37 function save($handle, $uri = null)
38 {
39 if ($uri == null)
40 return imagegd($handle);
41 else
42 return imagegd($handle, $uri);
43 }
44 }
45