if (fread(&count, sizeof count, 1, img->f) != 1) goto readerr;
count = letohs(count); img->foff += sizeof count;
if (fread(&xval, sizeof xval, 1, img->f) != 1) goto readerr;
xval = letohs(xval); img->foff += sizeof xval;
if (fread(&count, sizeof count, 1, img->f) != 1) goto readerr;
count = letohs(count); img->foff += sizeof count;
if (fread(&xval, sizeof xval, 1, img->f) != 1) goto readerr;
xval = letohs(xval); img->foff += sizeof xval;