parent::setUp();
$this->filePath = __DIR__ . '/../../data/media/';
}
+
/**
- * Tests zTXt tag (compressed textual metadata)
+ * Tests zTXt tag (compressed textual metadata)
*/
function testPngNativetZtxt() {
$this->checkPHPExtension( 'zlib' );
// encoded as just \xA9.
$expected = "© 2010 Bawolff";
-
$this->assertArrayHasKey( 'text', $meta );
$meta = $meta['text'];
$this->assertArrayHasKey( 'Copyright', $meta );
* Test extraction of pHYs tags, which can tell what the
* actual resolution of the image is (aka in dots per meter).
*/
-/*
- function testPngPhysTag () {
+ /*
+ function testPngPhysTag() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'Png-native-test.png' );
$this->assertEquals( '2835/100', $meta['YResolution'] );
$this->assertEquals( 3, $meta['ResolutionUnit'] ); // 3 = cm
}
-*/
+ */
/**
* Given a normal static PNG, check the animation metadata returned.
$this->assertEquals( 8, $meta['bitDepth'] );
}
+
function testPngBitDepth1() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'1bit-png.png' );
$this->assertEquals( 'index-coloured', $meta['colorType'] );
}
+
function testPngRgbColour() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'rgb-png.png' );
$this->assertEquals( 'truecolour-alpha', $meta['colorType'] );
}
+
function testPngRgbNoAlphaColour() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'rgb-na-png.png' );
$this->assertEquals( 'truecolour', $meta['colorType'] );
}
+
function testPngGreyscaleColour() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'greyscale-png.png' );
$this->assertEquals( 'greyscale-alpha', $meta['colorType'] );
}
+
function testPngGreyscaleNoAlphaColour() {
$meta = PNGMetadataExtractor::getMetadata( $this->filePath .
'greyscale-na-png.png' );
$this->assertEquals( 'greyscale', $meta['colorType'] );
}
-
}