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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/ext/apple_png/apple_png.c +6 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ee347d852329d08bb54a22f38a656b74f8abffac
4
- data.tar.gz: 2a70ad73f16d77366845d179df821116cac8f3ed
3
+ metadata.gz: e83b5775a1a36b6065051834e3d5b2b63855bac2
4
+ data.tar.gz: 2aaa92bd49494879cad5e720f55c032e0d3ad656
5
5
  SHA512:
6
- metadata.gz: eaff6ca90ba20fb20dc3d779fa3f0d941c933f7f774cbd36e2a18c6b4c682b18e470825e31b532fa8e2dde89ba4758227ea8e60213097f840261ef927a9f2053
7
- data.tar.gz: e42c0562ef5a25d983c07cd12dc7876e7e5c4440ec514f6cfc93cb605cc9f7cc1be1c0a616a76c70f89aaa4643590a132a72955b2fbef740e4adbc1d1e3b83be
6
+ metadata.gz: 6851f02d8a1000043ed5ff2ab0d29975643d3b08c865fbd0f3e71c3547c38297b98911cd5d12dd39d0c872e4cdda2780c9feb13b2e66da0af510186dababf71c
7
+ data.tar.gz: 86efac6c485bb8bdba84411d2556bfd59f2ccf522827a15e6e8718a2368010b43014e307660df756be049f5a6230f6a305a76555fc00f25d8945fa6674d4005d
@@ -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
- for (unsigned int i = 0; i < N_VALID_CHUNK_NAMES; i++) {
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
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apple_png
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marvin Killing