如何識別圖片檔的真實副檔名(格式) - Linux

Table of Contents


如果輸入某張圖片

比如是 .gif or .tif

可是卻無法開啟

我想知道圖片的格式是否真的如它副檔名所顯示

或是被改過手腳

如 .jpg 改成 .gif 之類的

想請問有沒有 open source 可以判斷某張圖片檔的真實副檔名或格式?

--

All Comments

Ethan avatarEthan2013-12-05
Yuri avatarYuri2013-12-09
用 file 指令也很方便
Erin avatarErin2013-12-11
推薦書binary hack,裡面有寫file指令的原理