Alex 'AdUser' Z
11 years ago
3 changed files with 62 additions and 98 deletions
@ -1,15 +1,12 @@
|
||||
#ifndef HAS_IMAGE_H |
||||
typedef struct |
||||
{ |
||||
gdImagePtr data; |
||||
uint16_t res_x; |
||||
uint16_t res_y; |
||||
char *mime; |
||||
ImageInfo *info |
||||
Image *data; |
||||
const char *errstr; |
||||
} image_t; |
||||
/**
|
||||
* @returns: image_t * on success, NULL otherwise |
||||
*/ |
||||
image_t * |
||||
image_from_file(const char *path, const char **errstr); |
||||
|
||||
int image_load(image_t *img, const char *path); |
||||
|
||||
#endif |
||||
#define HAS_IMAGE_H 1 |
||||
|
@ -1,18 +0,0 @@
|
||||
#include <gd.h> |
||||
|
||||
#include "common.h" |
||||
#include "bitmap.h" |
||||
#include "image.h" |
||||
|
||||
int main(int argc, char **argv) |
||||
{ |
||||
image_t *img = NULL; |
||||
const char *err = NULL; |
||||
|
||||
img = image_from_file("test.png", &err); |
||||
if (img == NULL) { |
||||
printf("%s\n", err); |
||||
exit(EXIT_FAILURE); |
||||
} |
||||
exit(EXIT_SUCCESS); |
||||
} |
Loading…
Reference in new issue