Alex 'AdUser' Z
11 years ago
5 changed files with 88 additions and 6 deletions
@ -1,7 +1,14 @@
|
||||
all: |
||||
CFLAGS=-Wall -Wextra -O0 -g -ggdb -pedantic
|
||||
|
||||
all: test-image |
||||
|
||||
%.c: %.h |
||||
|
||||
%.o: %.c |
||||
gcc -O0 -Wall -Wextra -pedantic -ggdb $< -o $@
|
||||
|
||||
clean: |
||||
rm -f *.o
|
||||
|
||||
test-image: image.c test-image.c |
||||
gcc $(CFLAGS) -lmagic -lgd image.c test-image.c -o $@
|
||||
|
@ -1 +1,2 @@
|
||||
int image_load(void); |
||||
gdImagePtr |
||||
image_from_file(const char *path, char **errstr); |
||||
|
@ -0,0 +1,16 @@
|
||||
#include <gd.h> |
||||
|
||||
#include "main.h" |
||||
#include "image.h" |
||||
|
||||
int main(int argc, char **argv) { |
||||
gdImagePtr img = NULL; |
||||
char *err; |
||||
|
||||
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