some small twiks

This commit is contained in:
tth
2022-06-30 20:33:31 +02:00
parent ea74b86f01
commit 10dc0d2204
10 changed files with 391 additions and 13 deletions

View File

@@ -2,23 +2,45 @@
PNG aka "portable network graphics"s.
Un vrai merdier, en fait :(
*/
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <png.h>
#include <zlib.h>
#include "tthimage.h"
#undef DEBUG_LEVEL
#define DEBUG_LEVEL 1
#include "../tthimage.h"
/*
* les infos et le code ici viennent de
* http://www.libpng.org/pub/png/pngbook.html
*/
/* static mainprog_info wpng_info; */
/*::------------------------------------------------------------------::*/
static void writepng_version_info(void)
{
fprintf(stderr, " Compiled with libpng %s; using libpng %s.\n",
PNG_LIBPNG_VER_STRING, png_libpng_ver);
fprintf(stderr, " Compiled with zlib %s; using zlib %s.\n",
ZLIB_VERSION, zlib_version);
}
/*::------------------------------------------------------------------::*/
Image_Desc * Image_PNG_alloc_load(char *fname, int k)
{
#if DEBUG_LEVEL
fprintf(stderr, "%s ( '%s' %d )\n", __func__, fname, k);
writepng_version_info();
#endif
return 666;
}
@@ -26,12 +48,12 @@ return 666;
int Image_save_as_PNG(Image_Desc *img, char *fname, int p1, int p2)
{
FILE *fp;
int x, y;
int x, y, foo;
png_uint_32 pngv;
#if DEBUG_LEVEL
fprintf(stderr, "%s ( %p '%s' %d %d )\n", __func__, img, fname, p1, p2);
fprintf(stderr, " png version -> %d\n", png_access_version_number());
writepng_version_info();
#endif
return FULL_NUCKED;