1 #ifndef _JPG_H 2 #define _JPG_H 3 4 #include <sys/types.h> 5 6 #define _GNU_SOURCE 1 7 typedef struct { 8 uint height; 9 uint width; 10 uint stride; // The width of each row in memory, in bytes 11 } JPEG_INFO; 12 13 /* 14 * Checks if the file is a JPEG by looking for a valid JPEG header. 15 */ 16 bool file_is_jpg(char* file_path); 17 18 /* 19 * Reads a JPEG from a file into memory, in a format that Cairo can create a 20 * surface from. 21 */ 22 void* read_JPEG_file(char *filename, JPEG_INFO *jpg_info); 23 24 #endif
