We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
static int get_ext_header(char *filename) { FILE *handle; handle = fopen(filename, "rb"); int ret = NGX_IMAGE_NONE; //添加处理,访问格式不存在时关闭打开的文件
if(!handle) { return NGX_IMAGE_NONE; } else { unsigned short filetype;//bmp 0x4D42 if(fread(&filetype, sizeof(unsigned short), 1, handle)) { if( filetype == 0xD8FF) { ret = NGX_IMAGE_JPEG; } else if( filetype == 0x4947) { ret = NGX_IMAGE_GIF; } else if( filetype == 0x5089) { ret = NGX_IMAGE_PNG; } else if ( filetype == 0x4d42) { ret = NGX_IMAGE_BMP; //添加处理bmp格式 }
#if 0 else { ret = NGX_IMAGE_NONE; } #endif } } fclose(handle); return ret; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
static int get_ext_header(char *filename)
{
FILE *handle;
handle = fopen(filename, "rb");
int ret = NGX_IMAGE_NONE; //添加处理,访问格式不存在时关闭打开的文件
#if 0
else {
ret = NGX_IMAGE_NONE;
}
#endif
}
}
fclose(handle);
return ret;
}
The text was updated successfully, but these errors were encountered: