Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ushitora-anqou/fdfe247a0aa281f259542034ec9fa2ec to your computer and use it in GitHub Desktop.
Save ushitora-anqou/fdfe247a0aa281f259542034ec9fa2ec to your computer and use it in GitHub Desktop.
17a18
> #include "compat.h"
42c43
< char *filename;
---
> const char *filename;
158c159
< memcpy(String_val(tmp), buf + rowbytes * i, rowbytes);
---
> memcpy(Bytes_val(tmp), buf + rowbytes * i, rowbytes);
217c218
< char *filename;
---
> const char *filename;
270a272,275
> if (interlace_type != PNG_INTERLACE_NONE) {
> png_set_interlace_handling(png_ptr);
> }
>
281,282c286,288
< png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
< &interlace_type, NULL, NULL);
---
> // No need to call it again, I believe.
> // png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
> // &interlace_type, NULL, NULL);
312d317
< fprintf(stderr, "png short file\n");
315c320
< CAMLreturn(res);
---
> failwith("png short file");
316a322
>
330c336
< fprintf(stderr, "pngread.c: indexed image\n"); fflush(stderr);
---
> fprintf(stderr, "pngread.c: indexed image\n"); fflush(stderr);
335,336c341,342
< fprintf(stderr, "pngread.c: byte/pix= %d/%d\n", (int)(rowbytes),
< (int)width); fflush(stderr);
---
> fprintf(stderr, "pngread.c: byte/pix= %d/%d\n", (int)(rowbytes),
> (int)width); fflush(stderr);
359c365
< memcpy(String_val(tmp), buf + rowbytes * i, rowbytes);
---
> memcpy(Bytes_val(tmp), buf + rowbytes * i, rowbytes);
375,376c381,382
< sc fprintf(stderr, "width rowbytes: %d %d\n", width, rowbytes);
< fflush(stderr);
---
> sc fprintf(stderr, "width rowbytes: %d %d\n", width, rowbytes);
> fflush(stderr);
383c389
< memcpy(String_val(tmp), buf + rowbytes * i, rowbytes);
---
> memcpy(Bytes_val(tmp), buf + rowbytes * i, rowbytes);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment