FILExt - The File Extension Source

博客展示了从FILExt查到的常见图片文件(bmp、jpeg、png、tiff等)的标识信息,包含不同格式对应的多种类型标识,以及十六进制(Hex)和ASCII编码表示,为图片文件分类等提供参考。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

    在开发图片压缩服务的过程中遇到了一个问题:当图片服务器上的文件的扩展名不规范时(例如有些jpeg 文件的扩展名为.gif、有些文件的扩展名为".img",".10" 等等),图片压缩的程序从图片服务器请求这些文件,那么response 中的Content-Type 就存在问题,往往Content-Type 的内容与图片并不一致,甚至得到竟然是text/plain 之类的结果,从而导致无法选择恰当的编解码器对图片进行处理。
最后在 google 中搜到了 FILExt ,他的资料库中存储了上万种文件扩展名的相关信息,如对应的MimeType 、File Classification 等等,最重要的是里面有可以确定一个文件的文件类型的特征码(Identifier Characters),即文件的前n个字节,用这n个字节可以准确的辨认出文件的类型。

FILExt - The File Extension Source ( http://filext.com/index.php)
FILExt is a detailed database of file extensions and programs that use them.
截至到2004-07-15,FILExt 中已经有了16828 条记录;你甚至可以通过FILExt 的 blog 向FILExt 的库中添加你所掌握的某种新型文件的相关信息。

下面是在FileExt 查询 gif 后得到结果
Extension: GIF
Program and/or Extension Function What's This?Company What's This?
Graphic Interchange Format
Specific Notes What's This?
Graphic files in .GIF format can be manipulated by a large number of programs. Some programs, e.g., Fractint, us the GIF header to store program information so that when the file is opened the program sets itself to the state it was in when the file was last edited.
MIME Type What's This?File Classification What's This?Associated Links What's This?
image/gif
image/x-xbitmap
image/gi_
 
Identifying Characters What's This?
Hex: 47 49 46 38
ASCII: GIF8
or for GIF87a...
Hex: 47 49 46 38 37 61
ASCII: GIF87a
or for GIF89a...
Hex: 47 49 46 38 39 61
ASCII: GIF89a
Program ID What's This?
(None or Unknown)
General Notes What's This?
Various programs use this extension; too many to list individually. Take clues from the location of the file as a possible pointer to exactly which program is producing the file. The file's date and time can also help if you know which programs you were running when the file was written.
This is record 5048 last modified on 2004-02-02.

下面是从FILExt 中查到的另外几种常见图片的文件(bmp、jpeg、png、tiff)标识信息。
----------------------------
image/gif
image/x-xbitmap
image/gi_
Hex: 47 49 46 38
ASCII: GIF8
or for GIF87a...
Hex: 47 49 46 38 37 61
ASCII: GIF87a
or for GIF89a...
............................
Hex: 47 49 46 38 39 61
ASCII: GIF89a
----------------------------

----------------------------
image/jpeg
image/jpg
image/jp_
application/jpg
application/x-jpg
image/pjpeg
image/pipeg
image/vnd.swiftview-jpeg
image/x-xbitmap
............................
Hex: FF D8 FF
ASCII:
----------------------------

----------------------------
image/bmp
image/x-bmp
image/x-bitmap
image/x-xbitmap
image/x-win-bitmap
image/x-windows-bmp
image/ms-bmp
image/x-ms-bmp
application/bmp
application/x-bmp
application/x-win-bitmap
application/preview
............................
Hex: 42 4D
ASCII: BM
----------------------------

----------------------------
image/png
application/png
application/x-png
............................
Hex: 89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52
ASCII: .PNG........IHDR
----------------------------

----------------------------
image/tif
image/x-tif
image/tiff
image/x-tiff
application/tif
application/x-tif
application/tiff
application/x-tiff
............................
Hex: 49 49 2A 00
ASCII:
----------------------------

### 如何使用 ECharts 创建纵向柱状图 为了创建一个纵向柱状图,在ECharts中需要调整`xAxis`和`yAxis`的设置,使横轴成为类目轴而纵轴成为数值轴。具体来说,可以通过交换原本用于定义横向柱状图中的`xAxis`与`yAxis`属性来实现这一点[^2]。 下面是一个简单的例子,展示了如何通过JavaScript代码构建这样的图表: ```javascript var chartDom = document.getElementById('main'); var myChart = echarts.init(chartDom); var option; option = { title: { text: '示例纵向柱状图' }, tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } }, legend: {}, grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true }, xAxis: { type: 'value' // 设置为数值型 }, yAxis: { type: 'category', // 类目型 data: ['类别一', '类别二', '类别三', '类别四', '类别五'] }, series: [ { name: '销量', type: 'bar', data: [24210, 32524, 50434, 52421, 98742], label: { show: true, position: 'insideRight' } } ] }; if (option && typeof option === 'object') { myChart.setOption(option); } ``` 这段脚本初始化了一个名为`myChart`的对象,并设置了其选项参数以显示一个基本的纵向条形图。其中最关键的部分在于`xAxis`被设为数值类型(`type:'value'`),而`yAxis`则作为分类轴并指定了具体的类别数据。 此外,还可以进一步自定义样式和其他功能特性,比如添加提示框、网格线以及标签等元素,从而让图表更加美观易读。
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值