BMP   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 6
dl 0
loc 19
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A load() 0 3 1
A loadFromString() 0 3 1
A save() 0 7 2
1
<?php
2
	/**
3
##DOC-SIGNATURE##
4
5
    This file is part of WideImage.
6
		
7
    WideImage is free software; you can redistribute it and/or modify
8
    it under the terms of the GNU Lesser General Public License as published by
9
    the Free Software Foundation; either version 2.1 of the License, or
10
    (at your option) any later version.
11
		
12
    WideImage is distributed in the hope that it will be useful,
13
    but WITHOUT ANY WARRANTY; without even the implied warranty of
14
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
    GNU Lesser General Public License for more details.
16
		
17
    You should have received a copy of the GNU Lesser General Public License
18
    along with WideImage; if not, write to the Free Software
19
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20
21
    * @package Internal/Mappers
22
  **/
23
24
namespace WideImage\Mapper;
25
26
use WideImage\vendor\de77;
27
28
/**
29
 * Mapper support for BMP
30
 * 
31
 * @package Internal/Mappers
32
 */
33
class BMP
34
{
35
	public function load($uri)
36
	{
37
		return de77\BMP::imagecreatefrombmp($uri);
38
	}
39
	
40
	public function loadFromString($data)
41
	{
42
		return de77\BMP::imagecreatefromstring($data);
43
	}
44
	
45
	public function save($handle, $uri = null)
46
	{
47
		if ($uri == null) {
48
			return de77\BMP::imagebmp($handle);
49
		}
50
		
51
		return de77\BMP::imagebmp($handle, $uri);
52
	}
53
}
54