You should open the file in binary mode, "rb".
You should test that the file opened (a likely cause of your current trouble) :
Code:
if (!captcha) { perror("fopen"); exit(EXIT_FAILURE); }
You need to either make sure your structs are packed (and that you used explicitly-sized integers) or read the members one by one. It is more portable to read them one by one.
Code:
#define READ(f,x) fread(&(x), 1, sizeof(x), f)
typedef struct Head {
int32_t size; // include <inttypes.h> for int32_t and PRNd32
int16_t planes;
} Head;
Head h;
READ(f, h.size);
READ(f, h.planes);