rem: fd = open(path, O_RDONLY);
add: fd = open(path, O_RDONLY|O_BINARY);
context: identFile(char *path){    int fd;    unsigned char buffer[32];    assert(path!=NULL);    fd = open(path, O_RDONLY);    if (fd < 0) {	RErrorCode = RERR_OPEN;	return IM_ERROR;    }    if (read(fd, buffer, 32)<1) {	close(fd);	RErrorCode = RERR_READ;	return IM_ERROR;    }    close(fd);        /* check for XPM */    if (strncmp((char*)buffer, "/* XPM */", 9)==0) 	return IM_XPM;        /* check for TIFF */    if ((buffer[0]=='I' && buffer[1]=='I' && buffer[2]=='*' && buffer[3]==0)	||(buffer[0]=='M' && buffer[1]=='M' && buffer[2]==0 && buffer[3]=='*'))	return IM_TIFF;#ifdef USE_PNG    /* check for PNG */    if (png_check_sig(buffer, 8))	return IM_PNG;#endif        /* check for raw PPM or PGM */    if (buffer[0]=='P' && (buffer[1]=='5' || buffer[1]=='6'))	return IM_PPM;    /* check for JPEG */    if (buffer[0] == 0xff && buffer[1] == 0xd8)	return IM_JPEG;    /* check for GIF */    if (buffer[0] == 'G' && buffer[1] == 'I' && buffer[2] == 'F')	return IM_GIF;    return IM_UNKNOWN;}