|
5 | 5 | class VipsMetaTest extends PHPUnit_Framework_TestCase
|
6 | 6 | {
|
7 | 7 |
|
8 |
| - public function testVipsSetGet() |
9 |
| - { |
10 |
| - $filename = dirname(__FILE__) . "/images/img_0076.jpg"; |
11 |
| - $image = Vips\Image::newFromFile($filename, ["shrink" => 2]); |
| 8 | + public function testVipsSetGet() |
| 9 | + { |
| 10 | + $filename = dirname(__FILE__) . "/images/img_0076.jpg"; |
| 11 | + $image = Vips\Image::newFromFile($filename, ["shrink" => 2]); |
12 | 12 |
|
13 |
| - $image->poop = "banana"; |
14 |
| - $value = $image->poop; |
| 13 | + $image->poop = "banana"; |
| 14 | + $value = $image->poop; |
15 | 15 |
|
16 |
| - $this->assertEquals($value, "banana"); |
17 |
| - } |
| 16 | + $this->assertEquals($value, "banana"); |
| 17 | + } |
18 | 18 |
|
19 |
| - public function testVipsGetExifData() |
20 |
| - { |
21 |
| - $filename = dirname(__FILE__) . "/images/img_0076.jpg"; |
22 |
| - $image = Vips\Image::newFromFile($filename, ["shrink" => 2]); |
| 19 | + public function testVipsGetExifData() |
| 20 | + { |
| 21 | + $filename = dirname(__FILE__) . "/images/img_0076.jpg"; |
| 22 | + $image = Vips\Image::newFromFile($filename, ["shrink" => 2]); |
23 | 23 |
|
24 |
| - $name = "exif-data"; |
25 |
| - $exif = $image->$name; |
| 24 | + $name = "exif-data"; |
| 25 | + $exif = $image->$name; |
26 | 26 |
|
27 |
| - # 9724 bytes of exif attached ... this should work even without libexif |
28 |
| - $this->assertEquals(strlen($exif), 9724); |
29 |
| - } |
| 27 | + # 9724 bytes of exif attached ... this should work even without libexif |
| 28 | + $this->assertEquals(strlen($exif), 9724); |
| 29 | + } |
30 | 30 |
|
31 |
| - public function testVipsGetThumbnail() |
32 |
| - { |
33 |
| - $filename = dirname(__FILE__) . "/images/img_0076.jpg"; |
34 |
| - $image = Vips\Image::newFromFile($filename, ["shrink" => 2]); |
| 31 | + public function testVipsGetThumbnail() |
| 32 | + { |
| 33 | + $filename = dirname(__FILE__) . "/images/img_0076.jpg"; |
| 34 | + $image = Vips\Image::newFromFile($filename, ["shrink" => 2]); |
35 | 35 |
|
36 |
| - $thumbnail_data = $image->get("jpeg-thumbnail-data"); |
37 |
| - $thumb = Vips\Image::newFromBuffer($thumbnail_data); |
| 36 | + $thumbnail_data = $image->get("jpeg-thumbnail-data"); |
| 37 | + $thumb = Vips\Image::newFromBuffer($thumbnail_data); |
38 | 38 |
|
39 |
| - $this->assertEquals($thumb->width, 160); |
40 |
| - } |
| 39 | + $this->assertEquals($thumb->width, 160); |
| 40 | + } |
41 | 41 |
|
42 |
| - public function testVipsGetTypeof() |
43 |
| - { |
44 |
| - $filename = dirname(__FILE__) . "/images/img_0076.jpg"; |
45 |
| - $image = Vips\Image::newFromFile($filename, ["shrink" => 2]); |
| 42 | + public function testVipsGetTypeof() |
| 43 | + { |
| 44 | + $filename = dirname(__FILE__) . "/images/img_0076.jpg"; |
| 45 | + $image = Vips\Image::newFromFile($filename, ["shrink" => 2]); |
46 | 46 |
|
47 |
| - $gint = $image->typeof("width"); |
| 47 | + $gint = $image->typeof("width"); |
48 | 48 |
|
49 |
| - // should always be the same, I think |
50 |
| - $this->assertEquals($gint, 24); |
51 |
| - } |
| 49 | + // should always be the same, I think |
| 50 | + $this->assertEquals($gint, 24); |
| 51 | + } |
52 | 52 |
|
53 |
| - public function testVipsRemove() |
54 |
| - { |
55 |
| - $filename = dirname(__FILE__) . "/images/img_0076.jpg"; |
56 |
| - $image = Vips\Image::newFromFile($filename); |
| 53 | + public function testVipsRemove() |
| 54 | + { |
| 55 | + $filename = dirname(__FILE__) . "/images/img_0076.jpg"; |
| 56 | + $image = Vips\Image::newFromFile($filename); |
57 | 57 |
|
58 |
| - $exif = $image->get("exif-data"); |
59 |
| - $this->assertEquals(strlen($exif), 9724); |
| 58 | + $exif = $image->get("exif-data"); |
| 59 | + $this->assertEquals(strlen($exif), 9724); |
60 | 60 |
|
61 |
| - $image->remove("exif-data"); |
| 61 | + $image->remove("exif-data"); |
62 | 62 |
|
63 |
| - $this->expectException(Vips\Exception::class); |
64 |
| - $exif = $image->get("exif-data"); |
65 |
| - } |
| 63 | + $this->expectException(Vips\Exception::class); |
| 64 | + $exif = $image->get("exif-data"); |
| 65 | + } |
66 | 66 |
|
67 | 67 | }
|
| 68 | + |
| 69 | +/* |
| 70 | + * Local variables: |
| 71 | + * tab-width: 4 |
| 72 | + * c-basic-offset: 4 |
| 73 | + * End: |
| 74 | + * vim600: expandtab sw=4 ts=4 fdm=marker |
| 75 | + * vim<600: expandtab sw=4 ts=4 |
| 76 | + */ |
0 commit comments