2
* Copyright 2011, Moxiecode Systems AB
3
* Released under GPL License.
5
* License: http://www.plupload.com/license
6
* Contributing: http://www.plupload.com/contributing
11
import com.mxi.BinaryReader;
12
import flash.utils.ByteArray;
16
protected var _br:BinaryReader;
18
public function PNG(binData:ByteArray)
20
_br = new BinaryReader;
25
static public function test(binData:ByteArray) : Boolean
27
var sign:Array = [ 137, 80, 78, 71, 13, 10, 26, 10 ];
29
for (var i:int = sign.length - 1; i >= 0 ; i--) {
30
if (binData[i] != sign[i]) {
38
public function info() : Object
40
var chunk:Object, idx:uint;
42
chunk = _getChunkAt(8);
44
if (chunk.type == 'IHDR') {
48
height: _br.LONG(idx += 4)
56
private function _getChunkAt(idx:uint) : Object
58
var length:uint, type:String, start:uint, CRC:uint;
60
length = _br.LONG(idx);
61
type = _br.STRING(idx += 4, 4);
63
CRC = _br.LONG(idx + length);
b'\\ No newline at end of file'