Mercurial > projects > dwt-linux
comparison dwt/internal/image/PngPlteChunk.d @ 240:ce446666f5a2
Update to SWT 3.4M7
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 12 May 2008 19:13:01 +0200 |
parents | 380bad9f6852 |
children | c0d810de7093 |
comparison
equal
deleted
inserted
replaced
239:06a1f6829310 | 240:ce446666f5a2 |
---|---|
110 // Note: just ignore the palette. | 110 // Note: just ignore the palette. |
111 // if (!headerChunk.getCanHavePalette()) DWT.error(DWT.ERROR_INVALID_IMAGE); | 111 // if (!headerChunk.getCanHavePalette()) DWT.error(DWT.ERROR_INVALID_IMAGE); |
112 | 112 |
113 // Palette chunks' data fields must be event multiples | 113 // Palette chunks' data fields must be event multiples |
114 // of 3. Each 3-byte group represents an RGB value. | 114 // of 3. Each 3-byte group represents an RGB value. |
115 if (getLength() % 3 !is 0) DWT.error(DWT.ERROR_INVALID_IMAGE); | 115 if (getLength() % 3 !is 0) DWT.error(DWT.ERROR_INVALID_IMAGE); |
116 | 116 |
117 // Palettes cannot have more entries than 2^bitDepth | 117 // Palettes cannot have more entries than 2^bitDepth |
118 // where bitDepth is the bit depth of the image given | 118 // where bitDepth is the bit depth of the image given |
119 // in the IHDR chunk. | 119 // in the IHDR chunk. |
120 if (1 << headerChunk.getBitDepth() < paletteSize) { | 120 if (1 << headerChunk.getBitDepth() < paletteSize) { |