apple_png 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/apple_png/apple_png.c +6 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e83b5775a1a36b6065051834e3d5b2b63855bac2
|
4
|
+
data.tar.gz: 2aaa92bd49494879cad5e720f55c032e0d3ad656
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6851f02d8a1000043ed5ff2ab0d29975643d3b08c865fbd0f3e71c3547c38297b98911cd5d12dd39d0c872e4cdda2780c9feb13b2e66da0af510186dababf71c
|
7
|
+
data.tar.gz: 86efac6c485bb8bdba84411d2556bfd59f2ccf522827a15e6e8718a2368010b43014e307660df756be049f5a6230f6a305a76555fc00f25d8945fa6674d4005d
|
data/ext/apple_png/apple_png.c
CHANGED
@@ -257,7 +257,8 @@ static int readPngChunks(VALUE self, const char *oldPNG, size_t oldPngLength, dy
|
|
257
257
|
cursor += chunkLength + 12;
|
258
258
|
|
259
259
|
int isValidChunkName = 0;
|
260
|
-
|
260
|
+
unsigned int i = 0;
|
261
|
+
for (i = 0; i < N_VALID_CHUNK_NAMES; i++) {
|
261
262
|
if (strncmp(chunkType, VALID_CHUNK_NAMES[i], 4) == 0) {
|
262
263
|
isValidChunkName = 1;
|
263
264
|
break;
|
@@ -330,6 +331,10 @@ static int readPngChunks(VALUE self, const char *oldPNG, size_t oldPngLength, dy
|
|
330
331
|
dyn_arr_append(newPNG, chunkCRC_raw, 4);
|
331
332
|
|
332
333
|
if (breakLoop) {
|
334
|
+
// end with an IEND chunk
|
335
|
+
dyn_arr_append(newPNG, "\x00\x00\x00\x00", 4);
|
336
|
+
dyn_arr_append(newPNG, "IEND", 4);
|
337
|
+
dyn_arr_append(newPNG, "\xAE\x42\x60\x82", 4); // this is the checksum for all IEND chunks
|
333
338
|
break;
|
334
339
|
}
|
335
340
|
}
|