This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via d17b6815085fb9796a00d67d6d08994c454f88e7 (commit) via bc8762a2677421bed4a62a90953340fb151f1433 (commit) via 726c48cd8263a399242dcc0e7273b653690efddc (commit) via 3319a2a77a75332829881c5faa632110813e1aaa (commit) via 9312d0d036e98c1662b966604dd8d9ad9215c1ab (commit) from 4f696f6a05e20284f976c0ed1d99c6779adda778 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/d17b6815085fb9796a00d67d6d08994c454f8...
commit d17b6815085fb9796a00d67d6d08994c454f88e7 Author: Cyril Hrubis metan@ucw.cz Date: Tue Apr 17 16:09:35 2012 +0200
spiv: Make use of the errno from GP_LoadImage().
diff --git a/demos/spiv/spiv.c b/demos/spiv/spiv.c index bbe7ef0..1a1369f 100644 --- a/demos/spiv/spiv.c +++ b/demos/spiv/spiv.c @@ -26,8 +26,9 @@
*/
-#include <signal.h> #include <unistd.h> +#include <errno.h> +#include <signal.h> #include <string.h> #include <pthread.h>
@@ -129,9 +130,9 @@ static void *image_loader(void *ptr) cpu_timer_start(&timer, "Loading"); if ((img = GP_LoadImage(params->img_path, &callback)) == NULL) { GP_Fill(context, black_pixel); - GP_Text(context, NULL, context->w/2, context->h/2, - GP_ALIGN_CENTER|GP_VALIGN_CENTER, white_pixel, black_pixel, - "Failed to load image :("); + GP_Print(context, NULL, context->w/2, context->h/2, + GP_ALIGN_CENTER|GP_VALIGN_CENTER, white_pixel, black_pixel, + "Failed to load image :( (%s)", strerror(errno)); GP_BackendFlip(backend); return NULL; }
http://repo.or.cz/w/gfxprim.git/commit/bc8762a2677421bed4a62a90953340fb151f1...
commit bc8762a2677421bed4a62a90953340fb151f1433 Author: Cyril Hrubis metan@ucw.cz Date: Tue Apr 17 16:09:08 2012 +0200
loaders: Convert JPG loader to use errno for error reporting.
diff --git a/include/loaders/GP_JPG.h b/include/loaders/GP_JPG.h index db9c51f..37d7d2e 100644 --- a/include/loaders/GP_JPG.h +++ b/include/loaders/GP_JPG.h @@ -35,26 +35,23 @@ /* * Opens up file and checks signature. */ -GP_RetCode GP_OpenJPG(const char *src_path, FILE **f); +int GP_OpenJPG(const char *src_path, FILE **f);
/* * Reads JPG from an open FILE. Expects the file possition set after the eight * bytes JPG signature. */ -GP_RetCode GP_ReadJPG(FILE *f, GP_Context **res, - GP_ProgressCallback *callback); +GP_Context *GP_ReadJPG(FILE *f, GP_ProgressCallback *callback);
/* * Loads a JPG file into GP_Context. The Context is newly allocated. */ -GP_RetCode GP_LoadJPG(const char *src_path, GP_Context **res, - GP_ProgressCallback *callback); +GP_Context *GP_LoadJPG(const char *src_path, GP_ProgressCallback *callback);
/* * Saves JPG to a file. */ -GP_RetCode GP_SaveJPG(const char *dst_path, const GP_Context *src, - GP_ProgressCallback *callback); - +int GP_SaveJPG(const char *dst_path, const GP_Context *src, + GP_ProgressCallback *callback);
#endif /* LOADERS_GP_JPG_H */ diff --git a/libs/loaders/GP_JPG.c b/libs/loaders/GP_JPG.c index 4ea6e35..00ff0c5 100644 --- a/libs/loaders/GP_JPG.c +++ b/libs/loaders/GP_JPG.c @@ -43,24 +43,27 @@
#include <jpeglib.h>
-GP_RetCode GP_OpenJPG(const char *src_path, FILE **f) +int GP_OpenJPG(const char *src_path, FILE **f) { + int err; + *f = fopen(src_path, "rb");
if (*f == NULL) { + err = errno; GP_DEBUG(1, "Failed to open '%s' : %s", src_path, strerror(errno)); - return GP_EBADFILE; + errno = err; + return 1; }
//TODO: check signature and rewind the stream - return GP_ESUCCESS; + return 0; }
struct my_jpg_err { struct jpeg_error_mgr error_mgr; - jmp_buf setjmp_buf; };
@@ -91,21 +94,19 @@ static const char *get_colorspace(J_COLOR_SPACE color_space) }; }
-GP_RetCode GP_ReadJPG(FILE *f, GP_Context **res, - GP_ProgressCallback *callback) +GP_Context *GP_ReadJPG(FILE *f, GP_ProgressCallback *callback) { struct jpeg_decompress_struct cinfo; struct my_jpg_err my_err; GP_Context *ret = NULL; + int err;
cinfo.err = jpeg_std_error(&my_err.error_mgr); my_err.error_mgr.error_exit = my_error_exit;
if (setjmp(my_err.setjmp_buf)) { - jpeg_destroy_decompress(&cinfo); - GP_ContextFree(ret); - fclose(f); - return GP_EBADFILE; + err = EIO; + goto err2; }
jpeg_create_decompress(&cinfo); @@ -134,9 +135,8 @@ GP_RetCode GP_ReadJPG(FILE *f, GP_Context **res, if (pixel_type == GP_PIXEL_UNKNOWN) { GP_DEBUG(1, "Can't handle %s JPEG output format", get_colorspace(cinfo.out_color_space)); - jpeg_destroy_decompress(&cinfo); - fclose(f); - return GP_EBADFILE; + err = ENOSYS; + goto err1; }
ret = GP_ContextAlloc(cinfo.image_width, cinfo.image_height, @@ -144,9 +144,8 @@ GP_RetCode GP_ReadJPG(FILE *f, GP_Context **res,
if (ret == NULL) { GP_DEBUG(1, "Malloc failed :("); - jpeg_destroy_decompress(&cinfo); - fclose(f); - return GP_ENOMEM; + err = ENOMEM; + goto err1; }
jpeg_start_decompress(&cinfo); @@ -171,60 +170,65 @@ GP_RetCode GP_ReadJPG(FILE *f, GP_Context **res, if (GP_ProgressCallbackReport(callback, y, ret->h, ret->w)) { GP_DEBUG(1, "Operation aborted"); - jpeg_destroy_decompress(&cinfo); - fclose(f); - GP_ContextFree(ret); - return GP_EINTR; + err = ECANCELED; + goto err2; } }
jpeg_finish_decompress(&cinfo); jpeg_destroy_decompress(&cinfo); fclose(f); - *res = ret;
GP_ProgressCallbackDone(callback); - return GP_ESUCCESS; + + return ret; +err2: + GP_ContextFree(ret); +err1: + jpeg_destroy_decompress(&cinfo); + fclose(f); + errno = err; + return NULL; }
-GP_RetCode GP_LoadJPG(const char *src_path, GP_Context **res, - GP_ProgressCallback *callback) +GP_Context *GP_LoadJPG(const char *src_path, GP_ProgressCallback *callback) { FILE *f; - GP_RetCode ret;
- if ((ret = GP_OpenJPG(src_path, &f))) - return ret; + if (GP_OpenJPG(src_path, &f)) + return NULL;
- return GP_ReadJPG(f, res, callback); + return GP_ReadJPG(f, callback); }
-GP_RetCode GP_SaveJPG(const char *dst_path, const GP_Context *src, - GP_ProgressCallback *callback) +int GP_SaveJPG(const char *dst_path, const GP_Context *src, + GP_ProgressCallback *callback) { FILE *f; - GP_RetCode ret; struct jpeg_compress_struct cinfo; struct my_jpg_err my_err; + int err;
if (src->pixel_type != GP_PIXEL_RGB888 && src->pixel_type != GP_PIXEL_G8) { GP_DEBUG(1, "Can't save png with pixel type %s", GP_PixelTypeName(src->pixel_type)); - return GP_ENOIMPL; + errno = ENOSYS; + return 1; }
f = fopen(dst_path, "wb");
if (f == NULL) { + err = errno; GP_DEBUG(1, "Failed to open '%s' for writing: %s", dst_path, strerror(errno)); - return GP_EBADFILE; + goto err0; } if (setjmp(my_err.setjmp_buf)) { - ret = GP_EBADFILE;; - goto err1; + err = EIO; + goto err2; }
cinfo.err = jpeg_std_error(&my_err.error_mgr); @@ -267,56 +271,61 @@ GP_RetCode GP_SaveJPG(const char *dst_path, const GP_Context *src, if (GP_ProgressCallbackReport(callback, y, src->h, src->w)) { GP_DEBUG(1, "Operation aborted"); - ret = GP_EINTR; - goto err1; + err = ECANCELED; + goto err2; } }
jpeg_finish_compress(&cinfo);
if (fclose(f)) { + err = errno; GP_DEBUG(1, "Failed to close file '%s': %s", dst_path, strerror(errno)); - return GP_EBADFILE; + goto err1; }
GP_ProgressCallbackDone(callback); - return GP_ESUCCESS; + return 0; //TODO: is cinfo allocated? -err1: +err2: jpeg_destroy_compress(&cinfo); fclose(f); +err1: unlink(dst_path); - return ret; +err0: + errno = err; + return 1; }
#else
-GP_RetCode GP_OpenJPG(const char GP_UNUSED(*src_path), - FILE GP_UNUSED(**f)) +int GP_OpenJPG(const char GP_UNUSED(*src_path), FILE GP_UNUSED(**f)) { - return GP_ENOIMPL; + errno = ENOSYS; + return 1; }
-GP_RetCode GP_ReadJPG(FILE GP_UNUSED(*f), - GP_Context GP_UNUSED(**res), +GP_Context *GP_ReadJPG(FILE GP_UNUSED(*f), GP_ProgressCallback GP_UNUSED(*callback)) { - return GP_ENOIMPL; + errno = ENOSYS; + return NULL; }
-GP_RetCode GP_LoadJPG(const char GP_UNUSED(*src_path), - GP_Context GP_UNUSED(**res), - GP_ProgressCallback GP_UNUSED(*callback)) +GP_Context *GP_LoadJPG(const char GP_UNUSED(*src_path), + GP_ProgressCallback GP_UNUSED(*callback)) { - return GP_ENOIMPL; + errno = ENOSYS; + return NULL; }
-GP_RetCode GP_SaveJPG(const char GP_UNUSED(*dst_path), - const GP_Context GP_UNUSED(*src), - GP_ProgressCallback GP_UNUSED(*callback)) +int GP_SaveJPG(const char GP_UNUSED(*dst_path), + const GP_Context GP_UNUSED(*src), + GP_ProgressCallback GP_UNUSED(*callback)) { - return GP_ENOIMPL; + errno = ENOSYS; + return 1; }
#endif /* HAVE_JPEG */ diff --git a/libs/loaders/GP_Loaders.c b/libs/loaders/GP_Loaders.c index 05e7c15..07368fe 100644 --- a/libs/loaders/GP_Loaders.c +++ b/libs/loaders/GP_Loaders.c @@ -71,7 +71,7 @@ GP_Context *GP_LoadImage(const char *src_path, GP_ProgressCallback *callback) case 'P': if (src_path[len - 3] == 'j' || src_path[len - 3] == 'J') - GP_LoadJPG(src_path, &res, callback); + res = GP_LoadJPG(src_path, callback); break; case 'e': case 'E': @@ -79,7 +79,7 @@ GP_Context *GP_LoadImage(const char *src_path, GP_ProgressCallback *callback) src_path[len - 3] == 'P') && (src_path[len - 4] == 'j' || src_path[len - 4] == 'J')) - GP_LoadJPG(src_path, &res, callback); + res = GP_LoadJPG(src_path, callback); break; } break;
http://repo.or.cz/w/gfxprim.git/commit/726c48cd8263a399242dcc0e7273b653690ef...
commit 726c48cd8263a399242dcc0e7273b653690efddc Author: Cyril Hrubis metan@ucw.cz Date: Tue Apr 17 15:42:01 2012 +0200
loaders: Convert PNG loader to use errno for error reporting.
diff --git a/include/loaders/GP_PNG.h b/include/loaders/GP_PNG.h index 1b4d9cf..2710b15 100644 --- a/include/loaders/GP_PNG.h +++ b/include/loaders/GP_PNG.h @@ -33,28 +33,42 @@ #include "core/GP_Context.h"
/* - * Opens up file and checks signature. Upon successful return the file - * possition would be set to eight bytes (exactly after the PNG signature). + * The possible errno values: + * + * - Anything FILE operation may return (fopen(), fclose(), fseek(), ...). + * - EIO for png_read()/png_write() failure + * - ENOSYS for not implemented bitmap format + * - ENOMEM from malloc() + * - EILSEQ for wrong image signature/data + * - ECANCELED when call was aborted from callback */ -GP_RetCode GP_OpenPNG(const char *src_path, FILE **f); + +/* + * Opens up file and checks signature. Upon successful return (zero is + * returned) the file possition would be set to eight bytes (exactly after the + * PNG signature). + */ +int GP_OpenPNG(const char *src_path, FILE **f);
/* * Reads PNG from an open FILE. Expects the file possition set after the eight * bytes PNG signature. + * + * Upon succesfull return pointer to newly allocated context is returned. + * Otherwise NULL is returned and errno is filled. */ -GP_RetCode GP_ReadPNG(FILE *f, GP_Context **res, - GP_ProgressCallback *callback); +GP_Context *GP_ReadPNG(FILE *f, GP_ProgressCallback *callback);
/* - * Loads a PNG file into GP_Context. The Context is newly allocated. + * Does both GP_OpenPNG and GP_ReadPNG at once. */ -GP_RetCode GP_LoadPNG(const char *src_path, GP_Context **res, - GP_ProgressCallback *callback); +GP_Context *GP_LoadPNG(const char *src_path, GP_ProgressCallback *callback);
/* - * Saves PNG to a file. + * Saves PNG to a file. Zero is returned on succes. Upon failure non-zero is + * returned and errno is filled accordingly. */ -GP_RetCode GP_SavePNG(const char *dst_path, const GP_Context *src, - GP_ProgressCallback *callback); +int GP_SavePNG(const char *dst_path, const GP_Context *src, + GP_ProgressCallback *callback);
#endif /* LOADERS_GP_PNG_H */ diff --git a/libs/loaders/GP_Loaders.c b/libs/loaders/GP_Loaders.c index 290890a..05e7c15 100644 --- a/libs/loaders/GP_Loaders.c +++ b/libs/loaders/GP_Loaders.c @@ -65,7 +65,7 @@ GP_Context *GP_LoadImage(const char *src_path, GP_ProgressCallback *callback) case 'N': if (src_path[len - 3] == 'p' || src_path[len - 3] == 'P') - GP_LoadPNG(src_path, &res, callback); + res = GP_LoadPNG(src_path, callback); break; case 'p': case 'P': diff --git a/libs/loaders/GP_PNG.c b/libs/loaders/GP_PNG.c index c430e72..02d9980 100644 --- a/libs/loaders/GP_PNG.c +++ b/libs/loaders/GP_PNG.c @@ -41,37 +41,42 @@
#include <png.h>
-GP_RetCode GP_OpenPNG(const char *src_path, FILE **f) +int GP_OpenPNG(const char *src_path, FILE **f) { uint8_t sig[8]; + int err;
*f = fopen(src_path, "r");
if (*f == NULL) { + err = errno; GP_DEBUG(1, "Failed to open '%s' : %s", src_path, strerror(errno)); - return GP_EBADFILE; + goto err1; }
if (fread(sig, 1, 8, *f) <= 0) { + err = errno; GP_DEBUG(1, "Failed to read '%s' : %s", src_path, strerror(errno)); - goto err; + goto err2; }
if (png_sig_cmp(sig, 0, 8)) { GP_DEBUG(1, "Invalid file header, '%s' not a PNG image?", src_path); - goto err; + err = EILSEQ; + goto err2; }
GP_DEBUG(1, "Found PNG signature in '%s'", src_path);
- return GP_ESUCCESS; -err: + return 0; +err2: fclose(*f); - *f = NULL; - return GP_EBADFILE; +err1: + errno = err; + return 1; }
static const char *interlace_type_name(int interlace) @@ -86,21 +91,21 @@ static const char *interlace_type_name(int interlace) } }
-GP_RetCode GP_ReadPNG(FILE *f, GP_Context **res, - GP_ProgressCallback *callback) +GP_Context *GP_ReadPNG(FILE *f, GP_ProgressCallback *callback) { png_structp png; png_infop png_info = NULL; png_uint_32 w, h; int depth, color_type, interlace_type; GP_PixelType pixel_type = GP_PIXEL_UNKNOWN; - GP_RetCode ret; + GP_Context *res; + int err;
png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (png == NULL) { GP_DEBUG(1, "Failed to allocate PNG read buffer"); - ret = GP_ENOMEM; + err = ENOMEM; goto err1; }
@@ -108,13 +113,14 @@ GP_RetCode GP_ReadPNG(FILE *f, GP_Context **res,
if (png_info == NULL) { GP_DEBUG(1, "Failed to allocate PNG info buffer"); - ret = GP_ENOMEM; + err = ENOMEM; goto err2; }
if (setjmp(png_jmpbuf(png))) { GP_DEBUG(1, "Failed to read PNG file :("); - ret = GP_EBADFILE; + //TODO: should we get better error description from libpng? + err = EIO; goto err2; }
@@ -180,14 +186,14 @@ GP_RetCode GP_ReadPNG(FILE *f, GP_Context **res,
if (pixel_type == GP_PIXEL_UNKNOWN) { GP_DEBUG(1, "Unimplemented png format"); - ret = GP_ENOIMPL; + err = ENOSYS; goto err2; }
- *res = GP_ContextAlloc(w, h, pixel_type); + res = GP_ContextAlloc(w, h, pixel_type);
- if (*res == NULL) { - ret = GP_ENOMEM; + if (res == NULL) { + err = ENOMEM; goto err2; }
@@ -195,83 +201,84 @@ GP_RetCode GP_ReadPNG(FILE *f, GP_Context **res, /* start the actuall reading */ for (y = 0; y < h; y++) { - png_bytep row = GP_PIXEL_ADDR(*res, 0, y); + png_bytep row = GP_PIXEL_ADDR(res, 0, y); png_read_rows(png, &row, NULL, 1);
if (GP_ProgressCallbackReport(callback, y, h, w)) { GP_DEBUG(1, "Operation aborted"); - png_destroy_read_struct(&png, &png_info, NULL); - fclose(f); - GP_ContextFree(*res); - return GP_EINTR; + err= ECANCELED; + goto err3; } }
GP_ProgressCallbackDone(callback);
- ret = GP_ESUCCESS; + return res; +err3: + GP_ContextFree(res); err2: png_destroy_read_struct(&png, png_info ? &png_info : NULL, NULL); err1: fclose(f); - return ret; + errno = err; + return NULL; }
-GP_RetCode GP_LoadPNG(const char *src_path, GP_Context **res, - GP_ProgressCallback *callback) +GP_Context *GP_LoadPNG(const char *src_path, GP_ProgressCallback *callback) { FILE *f; - GP_RetCode ret;
- if ((ret = GP_OpenPNG(src_path, &f))) - return ret; + if (GP_OpenPNG(src_path, &f)) + return NULL;
- return GP_ReadPNG(f, res, callback); + return GP_ReadPNG(f, callback); }
-GP_RetCode GP_SavePNG(const char *dst_path, const GP_Context *src, - GP_ProgressCallback *callback) +int GP_SavePNG(const char *dst_path, const GP_Context *src, + GP_ProgressCallback *callback) { FILE *f; - GP_RetCode ret; png_structp png; png_infop png_info = NULL; + int err;
if (src->pixel_type != GP_PIXEL_RGB888) { GP_DEBUG(1, "Can't save png with pixel type %s", GP_PixelTypeName(src->pixel_type)); - return GP_ENOIMPL; + return ENOSYS; }
f = fopen(dst_path, "wb");
if (f == NULL) { + err = errno; GP_DEBUG(1, "Failed to open '%s' for writing: %s", dst_path, strerror(errno)); - return GP_EBADFILE; + goto err0; }
png = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (png == NULL) { GP_DEBUG(1, "Failed to allocate PNG write buffer"); - ret = GP_ENOMEM; - goto err1; + err = ENOMEM; + goto err2; }
png_info = png_create_info_struct(png);
if (png_info == NULL) { GP_DEBUG(1, "Failed to allocate PNG info buffer"); - ret = GP_ENOMEM; - goto err2; + err = ENOMEM; + goto err3; }
if (setjmp(png_jmpbuf(png))) { GP_DEBUG(1, "Failed to write PNG file :("); - ret = GP_EBADFILE; - goto err2; + //TODO: should we get better error description from libpng? + err = EIO; + goto err3; }
png_init_io(png, f); @@ -291,8 +298,8 @@ GP_RetCode GP_SavePNG(const char *dst_path, const GP_Context *src,
if (GP_ProgressCallbackReport(callback, y, src->h, src->w)) { GP_DEBUG(1, "Operation aborted"); - ret = GP_EINTR; - goto err2; + err = ECANCELED; + goto err3; } } @@ -301,48 +308,55 @@ GP_RetCode GP_SavePNG(const char *dst_path, const GP_Context *src, png_destroy_write_struct(&png, &png_info);
if (fclose(f)) { + err = errno; GP_DEBUG(1, "Failed to close file '%s': %s", dst_path, strerror(errno)); - return GP_EBADFILE; + goto err1; }
GP_ProgressCallbackDone(callback); - return GP_ESUCCESS; -err2: + + return 0; +err3: png_destroy_write_struct(&png, png_info == NULL ? NULL : &png_info); -err1: +err2: fclose(f); +err1: unlink(dst_path); - return ret; +err0: + errno = err; + return 1; }
#else
-GP_RetCode GP_OpenPNG(const char GP_UNUSED(*src_path), - FILE GP_UNUSED(**f)) +int GP_OpenPNG(const char GP_UNUSED(*src_path), + FILE GP_UNUSED(**f)) { - return GP_ENOIMPL; + errno = ENOSYS; + return 1; }
-GP_RetCode GP_ReadPNG(FILE GP_UNUSED(*f), - GP_Context GP_UNUSED(**res), - GP_ProgressCallback GP_UNUSED(*callback)) +GP_Context *GP_ReadPNG(FILE GP_UNUSED(*f), + GP_ProgressCallback GP_UNUSED(*callback)) { - return GP_ENOIMPL; + errno = ENOSYS; + return NULL; }
-GP_RetCode GP_LoadPNG(const char GP_UNUSED(*src_path), - GP_Context GP_UNUSED(**res), - GP_ProgressCallback GP_UNUSED(*callback)) +GP_Context *GP_LoadPNG(const char GP_UNUSED(*src_path), + GP_ProgressCallback GP_UNUSED(*callback)) { - return GP_ENOIMPL; + errno = ENOSYS; + return NULL; }
-GP_RetCode GP_SavePNG(const char GP_UNUSED(*dst_path), - const GP_Context GP_UNUSED(*src), - GP_ProgressCallback GP_UNUSED(*callback)) +int GP_SavePNG(const char GP_UNUSED(*dst_path), + const GP_Context GP_UNUSED(*src), + GP_ProgressCallback GP_UNUSED(*callback)) { - return GP_ENOIMPL; + errno = ENOSYS; + return 1; }
#endif /* HAVE_LIBPNG */
http://repo.or.cz/w/gfxprim.git/commit/3319a2a77a75332829881c5faa632110813e1...
commit 3319a2a77a75332829881c5faa632110813e1aaa Author: Cyril Hrubis metan@ucw.cz Date: Tue Apr 17 15:02:19 2012 +0200
loaders: Convert BMP loader to use errno for error reporting.
diff --git a/include/loaders/GP_BMP.h b/include/loaders/GP_BMP.h index 2f81017..e44d787 100644 --- a/include/loaders/GP_BMP.h +++ b/include/loaders/GP_BMP.h @@ -27,28 +27,39 @@ #include "core/GP_ProgressCallback.h"
/* + * The possible errno values: + * + * - Anything FILE operation may return (fopen(), fclose(), fseek(), ...). + * - EIO for fread()/fwrite() failure + * - ENOSYS for not implemented bitmap format + * - ENOMEM from malloc() + * - EILSEQ for wrong image signature/data + * - ECANCELED when call was aborted from callback + */ + +/* * Opens up a bmp file, checks signature, parses metadata. * - * The width and height and pixel type are filled upon succcessful return. + * The file, width, height and pixel type are filled upon succcessful return. + * + * Upon failure, non zero return value is returned and errno is filled. */ -GP_RetCode GP_OpenBMP(const char *src_path, FILE **f, - GP_Size *w, GP_Size *h, GP_PixelType *pixel_type); +int GP_OpenBMP(const char *src_path, FILE **f, + GP_Size *w, GP_Size *h, GP_PixelType *pixel_type);
/* * Reads a BMP from a opened file. * - * Upon successful return context to store bitmap is allocated and image is + * Upon successful return, context to store bitmap is allocated and image is * loaded. * + * Upon failure NULL is returned and errno is filled. */ -GP_RetCode GP_ReadBMP(FILE *f, GP_Context **res, - GP_ProgressCallback *callback); +GP_Context *GP_ReadBMP(FILE *f, GP_ProgressCallback *callback);
/* * Does both GP_OpenBMP and GP_ReadBMP. */ -GP_RetCode GP_LoadBMP(const char *src_path, GP_Context **res, - GP_ProgressCallback *callback); - +GP_Context *GP_LoadBMP(const char *src_path, GP_ProgressCallback *callback);
#endif /* LOADERS_GP_BMP_H */ diff --git a/libs/loaders/GP_BMP.c b/libs/loaders/GP_BMP.c index 97b1b0b..d7ac6c5 100644 --- a/libs/loaders/GP_BMP.c +++ b/libs/loaders/GP_BMP.c @@ -146,14 +146,13 @@ static uint32_t get_palette_size(struct bitmap_info_header *header) return (1 << header->bpp); }
-static GP_RetCode read_bitmap_info_header(FILE *f, - struct bitmap_info_header *header) +static int read_bitmap_info_header(FILE *f, struct bitmap_info_header *header) { uint8_t buf[36];
if (fread(buf, 1, sizeof(buf), f) != sizeof(buf)) { GP_DEBUG(1, "Failed to read bitmap info header"); - return GP_EBADFILE; + return EIO; }
header->w = BUF_TO_4(buf, 0); @@ -175,17 +174,16 @@ static GP_RetCode read_bitmap_info_header(FILE *f, get_palette_size(header), bitmap_compress_name(header->compress_type));
- return GP_ESUCCESS; + return 0; }
-static GP_RetCode read_bitmap_core_header(FILE *f, - struct bitmap_info_header *header) +static int read_bitmap_core_header(FILE *f, struct bitmap_info_header *header) { uint8_t buf[12];
if (fread(buf, 1, sizeof(buf), f) != sizeof(buf)) { GP_DEBUG(1, "Failed to read bitmap core header"); - return GP_EBADFILE; + return EIO; } header->w = BUF_TO_2(buf, 0); @@ -204,25 +202,25 @@ static GP_RetCode read_bitmap_core_header(FILE *f, GP_DEBUG(2, "Have BMP bitmap size %"PRId32"x%"PRId32" %"PRIu16" bpp", header->h, header->w, header->bpp);
- return GP_ESUCCESS; + return 0; }
-static GP_RetCode read_bitmap_header(FILE *f, - struct bitmap_info_header *header) +static int read_bitmap_header(FILE *f, struct bitmap_info_header *header) { uint8_t buf[8]; - GP_RetCode ret; - + int err; + if (fseek(f, BMP_HEADER_OFFSET, SEEK_SET)) { + err = errno; GP_DEBUG(1, "fseek(f, 0x%02x) failed: '%s'", BMP_HEADER_OFFSET, strerror(errno)); - return GP_EBADFILE; + return err; }
/* Read info header size, header size determines header type */ if (fread(buf, 1, sizeof(buf), f) != sizeof(buf)) { GP_DEBUG(1, "Failed to read info header size"); - return GP_EBADFILE; + return EIO; }
header->pixel_offset = BUF_TO_4(buf, 0); @@ -233,36 +231,37 @@ static GP_RetCode read_bitmap_header(FILE *f,
switch (header->header_size) { case BITMAPCOREHEADER: - ret = read_bitmap_core_header(f, header); + err = read_bitmap_core_header(f, header); break; case BITMAPCOREHEADER2: - return GP_ENOIMPL; + return ENOSYS; /* The bitmap core header only adds filelds to the end of the header */ case BITMAPINFOHEADER: case BITMAPINFOHEADER2: case BITMAPINFOHEADER3: case BITMAPINFOHEADER4: - ret = read_bitmap_info_header(f, header); + err = read_bitmap_info_header(f, header); break; default: GP_DEBUG(1, "Unknown header type, continuing anyway"); - ret = read_bitmap_info_header(f, header); + err = read_bitmap_info_header(f, header); break; }; - return ret; + return err; }
/* * Reads palette, the format is R G B X, each one byte. */ -GP_RetCode read_bitmap_palette(FILE *f, struct bitmap_info_header *header, +static int read_bitmap_palette(FILE *f, struct bitmap_info_header *header, GP_Pixel *palette) { - uint32_t i; uint32_t palette_colors = get_palette_size(header); uint32_t palette_offset = header->header_size + 14; uint8_t pixel_size; + uint32_t i; + int err;
switch (header->header_size) { case BITMAPCOREHEADER: @@ -278,9 +277,10 @@ GP_RetCode read_bitmap_palette(FILE *f, struct bitmap_info_header *header, palette_offset, palette_offset, pixel_size);
if (fseek(f, palette_offset, SEEK_SET)) { + err = errno; GP_DEBUG(1, "fseek(f, 0x%02x) failed: '%s'", BMP_HEADER_OFFSET, strerror(errno)); - return GP_EBADFILE; + return err; }
for (i = 0; i < palette_colors; i++) { @@ -288,7 +288,7 @@ GP_RetCode read_bitmap_palette(FILE *f, struct bitmap_info_header *header,
if (fread(buf, 1, pixel_size, f) != pixel_size) { GP_DEBUG(1, "Failed to read palette %"PRIu32, i); - return GP_EBADFILE; + return EIO; } palette[i] = GP_Pixel_CREATE_RGB888(buf[2], buf[1], buf[0]); @@ -299,25 +299,27 @@ GP_RetCode read_bitmap_palette(FILE *f, struct bitmap_info_header *header, GP_Pixel_GET_B_RGB888(palette[i])); }
- return GP_ESUCCESS; + return 0; }
-GP_RetCode seek_pixels_offset(struct bitmap_info_header *header, - FILE *f) +static int seek_pixels_offset(struct bitmap_info_header *header, FILE *f) { + int err; + GP_DEBUG(2, "Offset to BMP pixels is 0x%x (%ubytes)", header->pixel_offset, header->pixel_offset);
if (fseek(f, header->pixel_offset, SEEK_SET)) { + err = errno; GP_DEBUG(1, "fseek(f, 0x%02x) failed: '%s'", header->pixel_offset, strerror(errno)); - return GP_EBADFILE; + return err; }
- return GP_ESUCCESS; + return 0; }
-GP_PixelType match_pixel_type(struct bitmap_info_header *header) +static GP_PixelType match_pixel_type(struct bitmap_info_header *header) { switch (header->bpp) { case 1: @@ -390,18 +392,18 @@ static uint8_t get_idx(struct bitmap_info_header *header, return 0; }
-GP_RetCode read_palette(FILE *f, struct bitmap_info_header *header, +static int read_palette(FILE *f, struct bitmap_info_header *header, GP_Context *context, GP_ProgressCallback *callback) { - GP_RetCode ret; uint32_t palette_size = get_palette_size(header); GP_Pixel palette[get_palette_size(header)]; + int err;
- if ((ret = read_bitmap_palette(f, header, palette))) - return ret; + if ((err = read_bitmap_palette(f, header, palette))) + return err; - if ((ret = seek_pixels_offset(header, f))) - return ret; + if ((err = seek_pixels_offset(header, f))) + return err; uint32_t row_size = bitmap_row_size(header); int32_t y; @@ -412,7 +414,7 @@ GP_RetCode read_palette(FILE *f, struct bitmap_info_header *header,
if (fread(row, 1, row_size, f) != row_size) { GP_DEBUG(1, "Failed to read row %"PRId32, y); - return GP_EBADFILE; + return EIO; } for (x = 0; x < header->w; x++) { @@ -439,23 +441,23 @@ GP_RetCode read_palette(FILE *f, struct bitmap_info_header *header, if (GP_ProgressCallbackReport(callback, header->h - y -1, context->h, context->w)) { GP_DEBUG(1, "Operation aborted"); - return GP_EINTR; + return ECANCELED; } } GP_ProgressCallbackDone(callback); - return GP_ESUCCESS; + return 0; }
-GP_RetCode read_rgb888(FILE *f, struct bitmap_info_header *header, +static int read_rgb888(FILE *f, struct bitmap_info_header *header, GP_Context *context, GP_ProgressCallback *callback) { - GP_RetCode ret; uint32_t row_size = 3 * header->w; int32_t y; + int err; - if ((ret = seek_pixels_offset(header, f))) - return ret; + if ((err = seek_pixels_offset(header, f))) + return err;
for (y = 0; y < GP_ABS(header->h); y++) { int32_t ry; @@ -467,9 +469,11 @@ GP_RetCode read_rgb888(FILE *f, struct bitmap_info_header *header, uint8_t *row = GP_PIXEL_ADDR(context, 0, ry);
- if (fread(row, 1, row_size, f) != row_size) - return GP_EBADFILE; - + if (fread(row, 1, row_size, f) != row_size) { + GP_DEBUG(1, "Failed to read row %"PRId32, y); + return EIO; + } + /* Rows are four byte aligned */ switch (row_size % 4) { case 1: @@ -485,15 +489,15 @@ GP_RetCode read_rgb888(FILE *f, struct bitmap_info_header *header, if (GP_ProgressCallbackReport(callback, header->h - y -1, context->h, context->w)) { GP_DEBUG(1, "Operation aborted"); - return GP_EINTR; + return ECANCELED; } }
GP_ProgressCallbackDone(callback); - return GP_ESUCCESS; + return 0; }
-GP_RetCode read_bitmap_pixels(FILE *f, struct bitmap_info_header *header, +static int read_bitmap_pixels(FILE *f, struct bitmap_info_header *header, GP_Context *context, GP_ProgressCallback *callback) { switch (header->bpp) { @@ -507,20 +511,21 @@ GP_RetCode read_bitmap_pixels(FILE *f, struct bitmap_info_header *header, return read_rgb888(f, header, context, callback); }
- return GP_ENOIMPL; + return ENOSYS; }
-GP_RetCode GP_OpenBMP(const char *src_path, FILE **f, - GP_Size *w, GP_Size *h, GP_PixelType *pixel_type) +int GP_OpenBMP(const char *src_path, FILE **f, + GP_Size *w, GP_Size *h, GP_PixelType *pixel_type) { - GP_RetCode ret = GP_EBADFILE; - + int err; + *f = fopen(src_path, "rb");
if (*f == NULL) { + err = errno; GP_DEBUG(1, "Failed to open '%s' : %s", src_path, strerror(errno)); - return GP_EBADFILE; + goto err2; }
int ch1 = fgetc(*f); @@ -530,78 +535,81 @@ GP_RetCode GP_OpenBMP(const char *src_path, FILE **f, GP_DEBUG(1, "Unexpected bitmap header 0x%02x (%c) 0x%02x (%c)", ch1, isascii(ch1) ? ch1 : ' ', ch2, isascii(ch2) ? ch2 : ' '); - goto err; + err = EILSEQ; + goto err1; } if (w != NULL || h != NULL || pixel_type != NULL) { struct bitmap_info_header header; - if ((ret = read_bitmap_header(*f, &header))) - goto err; + if ((err = read_bitmap_header(*f, &header))) + goto err1;
if (w != NULL) *w = header.w; if (h != NULL) *h = header.h; + + if (pixel_type != NULL) + *pixel_type = match_pixel_type(&header); }
- return GP_ESUCCESS; -err: + return 0; +err1: fclose(*f); - return GP_EBADFILE; +err2: + errno = err; + return 1; }
-GP_RetCode GP_ReadBMP(FILE *f, GP_Context **res, - GP_ProgressCallback *callback) +GP_Context *GP_ReadBMP(FILE *f, GP_ProgressCallback *callback) { struct bitmap_info_header header; - GP_RetCode ret; GP_PixelType pixel_type; + GP_Context *context; + int err;
- if ((ret = read_bitmap_header(f, &header))) - goto err; + if ((err = read_bitmap_header(f, &header))) + goto err1;
if (header.compress_type != COMPRESS_RGB) { - ret = GP_ENOIMPL; - goto err; + GP_DEBUG(2, "Unknown compression type"); + err = ENOSYS; + goto err1; }
if ((pixel_type = match_pixel_type(&header)) == GP_PIXEL_UNKNOWN) { - ret = GP_ENOIMPL; - goto err; + GP_DEBUG(2, "Unknown pixel type"); + err = ENOSYS; + goto err1; } - - GP_Context *context; context = GP_ContextAlloc(header.w, GP_ABS(header.h), pixel_type);
if (context == NULL) { - ret = GP_ENOMEM; - goto err; - } - - if ((ret = read_bitmap_pixels(f, &header, context, callback))) + err = ENOMEM; goto err1; + }
- *res = context; + if ((err = read_bitmap_pixels(f, &header, context, callback))) + goto err2;
- return GP_ESUCCESS; -err1: + return context; +err2: GP_ContextFree(context); -err: +err1: fclose(f); - return ret; + errno = err; + return NULL; }
-GP_RetCode GP_LoadBMP(const char *src_path, GP_Context **res, - GP_ProgressCallback *callback) +GP_Context *GP_LoadBMP(const char *src_path, GP_ProgressCallback *callback) { FILE *f; - GP_RetCode ret;
- if ((ret = GP_OpenBMP(src_path, &f, NULL, NULL, NULL))) - return ret; + if (GP_OpenBMP(src_path, &f, NULL, NULL, NULL)) + return NULL;
- return GP_ReadBMP(f, res, callback); + return GP_ReadBMP(f, callback); } diff --git a/libs/loaders/GP_Loaders.c b/libs/loaders/GP_Loaders.c index 7544b01..290890a 100644 --- a/libs/loaders/GP_Loaders.c +++ b/libs/loaders/GP_Loaders.c @@ -115,7 +115,7 @@ GP_Context *GP_LoadImage(const char *src_path, GP_ProgressCallback *callback) case 'm': if (src_path[len - 3] == 'B' || src_path[len - 3] == 'b') - GP_LoadBMP(src_path, &res, callback); + res = GP_LoadBMP(src_path, callback); break; } break;
http://repo.or.cz/w/gfxprim.git/commit/9312d0d036e98c1662b966604dd8d9ad9215c...
commit 9312d0d036e98c1662b966604dd8d9ad9215c1ab Author: Cyril Hrubis metan@ucw.cz Date: Tue Apr 17 14:18:19 2012 +0200
loaders: Starting to change image loaders API.
diff --git a/demos/grinder/grinder.c b/demos/grinder/grinder.c index 2822bcf..be3bf09 100644 --- a/demos/grinder/grinder.c +++ b/demos/grinder/grinder.c @@ -24,6 +24,7 @@ #include <stdlib.h> #include <unistd.h> #include <string.h> +#include <errno.h>
#include "GP.h"
@@ -601,7 +602,7 @@ static GP_RetCode arithmetic(GP_Context **c, const char *params)
GP_Context *img, *res = NULL;
- if (GP_LoadImage(file, &img, progress_callback)) { + if ((img = GP_LoadImage(file, progress_callback)) == NULL) { print_error("arithmetic: Invalid image."); return GP_EINVAL; } @@ -851,7 +852,6 @@ static void save_by_fmt(struct GP_Context *bitmap, const char *name, const char int main(int argc, char *argv[]) { GP_Context *bitmap; - GP_RetCode ret; int opt, i; const char *out_fmt = "ppm";
@@ -906,9 +906,8 @@ int main(int argc, char *argv[])
progress_prefix = "Loading image";
- if ((ret = GP_LoadImage(argv[i], &bitmap, progress_callback))) { - fprintf(stderr, "Failed to load bitmap: %sn", - GP_RetCodeName(ret)); + if ((bitmap = GP_LoadImage(argv[i], progress_callback)) == NULL) { + fprintf(stderr, "Failed to load bitmap: %sn", strerror(errno)); return 1; } diff --git a/demos/py_simple/blur.py b/demos/py_simple/blur.py index 5ed5271..80c35de 100755 --- a/demos/py_simple/blur.py +++ b/demos/py_simple/blur.py @@ -13,7 +13,7 @@ def main(): radii = int(sys.argv[1])
# Load Image - img = loaders.LoadImage_Wrap(sys.argv[2]) + img = loaders.LoadImage(sys.argv[2], None) # Do in-place gaussian blur filters.FilterGaussianBlur(img, img, radii, radii, None) # Save result diff --git a/demos/spiv/spiv.c b/demos/spiv/spiv.c index 7882839..bbe7ef0 100644 --- a/demos/spiv/spiv.c +++ b/demos/spiv/spiv.c @@ -115,6 +115,7 @@ static void *image_loader(void *ptr) GP_ProgressCallback callback = {.callback = image_loader_callback}; struct cpu_timer timer; struct cpu_timer sum_timer; + GP_Context *img;
cpu_timer_start(&sum_timer, "sum");
@@ -123,16 +124,15 @@ static void *image_loader(void *ptr)
fprintf(stderr, "Loading '%s'n", params->img_path);
- GP_Context *img = NULL; - callback.priv = "Loading image";
cpu_timer_start(&timer, "Loading"); - if (GP_LoadImage(params->img_path, &img, &callback) != 0) { + if ((img = GP_LoadImage(params->img_path, &callback)) == NULL) { GP_Fill(context, black_pixel); GP_Text(context, NULL, context->w/2, context->h/2, - GP_ALIGN_CENTER|GP_VALIGN_CENTER, black_pixel, white_pixel, + GP_ALIGN_CENTER|GP_VALIGN_CENTER, white_pixel, black_pixel, "Failed to load image :("); + GP_BackendFlip(backend); return NULL; } cpu_timer_stop(&timer); diff --git a/include/loaders/GP_Loaders.h b/include/loaders/GP_Loaders.h index 96b26c8..dd1ff12 100644 --- a/include/loaders/GP_Loaders.h +++ b/include/loaders/GP_Loaders.h @@ -44,9 +44,10 @@ #include "GP_JPG.h"
/* - * Tries to load image accordingly to extension. + * Tries to load image accordingly to the file extension. + * + * If operation fails NULL is returned and errno is filled. */ -GP_RetCode GP_LoadImage(const char *src_path, GP_Context **res, - GP_ProgressCallback *callback); +GP_Context *GP_LoadImage(const char *src_path, GP_ProgressCallback *callback);
#endif /* LOADERS_GP_LOADERS_H */ diff --git a/libs/loaders/GP_Loaders.c b/libs/loaders/GP_Loaders.c index 8ef8c63..7544b01 100644 --- a/libs/loaders/GP_Loaders.c +++ b/libs/loaders/GP_Loaders.c @@ -34,17 +34,24 @@
#include "GP_Loaders.h"
-GP_RetCode GP_LoadImage(const char *src_path, GP_Context **res, - GP_ProgressCallback *callback) +GP_Context *GP_LoadImage(const char *src_path, GP_ProgressCallback *callback) { - int len = strlen(src_path); - GP_RetCode ret = GP_ENOIMPL; - + int len, saved_errno; + GP_Context *res = NULL; + if (access(src_path, R_OK)) { + + saved_errno = errno; + GP_DEBUG(1, "Failed to access file '%s' : %s", src_path, strerror(errno)); - return GP_EBADFILE; + + errno = saved_errno; + + return NULL; } + + len = strlen(src_path);
if (len < 3) goto skip_filename_check; @@ -58,13 +65,13 @@ GP_RetCode GP_LoadImage(const char *src_path, GP_Context **res, case 'N': if (src_path[len - 3] == 'p' || src_path[len - 3] == 'P') - ret = GP_LoadPNG(src_path, res, callback); + GP_LoadPNG(src_path, &res, callback); break; case 'p': case 'P': if (src_path[len - 3] == 'j' || src_path[len - 3] == 'J') - ret = GP_LoadJPG(src_path, res, callback); + GP_LoadJPG(src_path, &res, callback); break; case 'e': case 'E': @@ -72,7 +79,7 @@ GP_RetCode GP_LoadImage(const char *src_path, GP_Context **res, src_path[len - 3] == 'P') && (src_path[len - 4] == 'j' || src_path[len - 4] == 'J')) - ret = GP_LoadJPG(src_path, res, callback); + GP_LoadJPG(src_path, &res, callback); break; } break; @@ -84,19 +91,19 @@ GP_RetCode GP_LoadImage(const char *src_path, GP_Context **res, case 'B': if (src_path[len - 3] == 'p' || src_path[len - 3] == 'P') - ret = GP_LoadPBM(src_path, res); + GP_LoadPBM(src_path, &res); break; case 'g': case 'G': if (src_path[len - 3] == 'p' || src_path[len - 3] == 'P') - ret = GP_LoadPGM(src_path, res); + GP_LoadPGM(src_path, &res); break; case 'p': case 'P': if (src_path[len - 3] == 'p' || src_path[len - 3] == 'P') - ret = GP_LoadPPM(src_path, res); + GP_LoadPPM(src_path, &res); break; } break; @@ -108,7 +115,7 @@ GP_RetCode GP_LoadImage(const char *src_path, GP_Context **res, case 'm': if (src_path[len - 3] == 'B' || src_path[len - 3] == 'b') - ret = GP_LoadBMP(src_path, res, callback); + GP_LoadBMP(src_path, &res, callback); break; } break; @@ -118,5 +125,5 @@ skip_filename_check:
//TODO file signature based check
- return ret; + return res; } diff --git a/pylib/gfxprim/loaders/loaders.i b/pylib/gfxprim/loaders/loaders.i index 990b07d..7939dd8 100644 --- a/pylib/gfxprim/loaders/loaders.i +++ b/pylib/gfxprim/loaders/loaders.i @@ -15,18 +15,6 @@
%include "GP_Loaders.h"
-%{ -GP_Context *GP_LoadImage_Wrap(const char *src_path) -{ - GP_Context *c = NULL; - if (GP_LoadImage(src_path, &c, NULL) != 0) - return NULL; - return c; -} -%} - -GP_Context *GP_LoadImage_Wrap(const char *src_path); - %include "GP_JPG.h" %include "GP_PBM.h" %include "GP_PGM.h" diff --git a/tests/SDL/blittest.c b/tests/SDL/blittest.c index 5136200..2d09436 100644 --- a/tests/SDL/blittest.c +++ b/tests/SDL/blittest.c @@ -23,8 +23,9 @@ * * *****************************************************************************/
-#include <stdio.h> #include <stdlib.h> +#include <stdio.h> +#include <errno.h> #include <SDL/SDL.h>
#include "GP.h" @@ -191,10 +192,8 @@ int main(int argc, char *argv[])
GP_SetDebugLevel(10);
- GP_RetCode ret; - - if ((ret = GP_LoadImage(sprite, &bitmap_raw, NULL))) { - fprintf(stderr, "Failed to load bitmap: %sn", GP_RetCodeName(ret)); + if ((bitmap_raw = GP_LoadImage(sprite, NULL)) == NULL) { + fprintf(stderr, "Failed to load bitmap: %sn", strerror(errno)); return 1; } diff --git a/tests/SDL/runtest.sh b/tests/SDL/runtest.sh index 73c9f61..163c76c 100755 --- a/tests/SDL/runtest.sh +++ b/tests/SDL/runtest.sh @@ -7,4 +7,4 @@ PROG="$1" shift
echo "LD_LIBRARY_PATH=../../build/ ./$PROG $@" -LD_LIBRARY_PATH=../../build/ ./$PROG $@ +LD_LIBRARY_PATH=../../build/ ./$PROG "$@" diff --git a/tests/SDL/showimage.c b/tests/SDL/showimage.c index b0f0839..90bc393 100644 --- a/tests/SDL/showimage.c +++ b/tests/SDL/showimage.c @@ -20,8 +20,9 @@ * * *****************************************************************************/
-#include <stdio.h> #include <stdlib.h> +#include <stdio.h> +#include <errno.h> #include <SDL/SDL.h>
#include "GP.h" @@ -91,10 +92,8 @@ int main(int argc, char *argv[])
GP_SetDebugLevel(10);
- GP_RetCode ret; - - if ((ret = GP_LoadImage(argv[1], &bitmap, NULL))) { - fprintf(stderr, "Failed to load bitmap: %sn", GP_RetCodeName(ret)); + if ((bitmap = GP_LoadImage(argv[1], NULL)) == NULL) { + fprintf(stderr, "Failed to load bitmap: %sn", strerror(errno)); return 1; }
-----------------------------------------------------------------------
Summary of changes: demos/grinder/grinder.c | 9 +- demos/py_simple/blur.py | 2 +- demos/spiv/spiv.c | 15 ++-- include/loaders/GP_BMP.h | 29 ++++-- include/loaders/GP_JPG.h | 13 +-- include/loaders/GP_Loaders.h | 7 +- include/loaders/GP_PNG.h | 36 ++++++--- libs/loaders/GP_BMP.c | 182 ++++++++++++++++++++------------------- libs/loaders/GP_JPG.c | 119 ++++++++++++++------------ libs/loaders/GP_Loaders.c | 35 +++++--- libs/loaders/GP_PNG.c | 142 +++++++++++++++++-------------- pylib/gfxprim/loaders/loaders.i | 12 --- tests/SDL/blittest.c | 9 +- tests/SDL/runtest.sh | 2 +- tests/SDL/showimage.c | 9 +- 15 files changed, 334 insertions(+), 287 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.