if (fread(&tmp.width, sizeof tmp.width, 1, f) != 1) goto readerr;
if (fread(&tmp.height, sizeof tmp.height, 1, f) != 1) goto readerr;
if (fread(&tmp.width, sizeof tmp.width, 1, f) != 1) goto readerr;
if (fread(&tmp.height, sizeof tmp.height, 1, f) != 1) goto readerr;