This page was machine-translated. Spotted a mistake?Help improve it.
Skip to content

圖片資訊

唯讀分析工具,傳回完整的圖片中繼資料,包含尺寸、格式、色彩空間、EXIF/ICC/XMP 是否存在,以及各通道色階分布統計。不會產生已處理的輸出檔案。

API 端點

POST /api/v1/tools/image/info

接受包含一個圖片檔案的 multipart 表單資料。不需要 settings 欄位。

參數

此工具沒有可設定的參數。只需上傳圖片檔案即可。

欄位型別必填說明
filefile要分析的圖片

範例請求

bash
curl -X POST http://localhost:1349/api/v1/tools/image/info \
  -H "Authorization: Bearer si_your-api-key" \
  -F "[email protected]"

範例回應

json
{
  "filename": "photo.jpg",
  "fileSize": 2450000,
  "width": 4032,
  "height": 3024,
  "format": "jpeg",
  "channels": 3,
  "hasAlpha": false,
  "colorSpace": "srgb",
  "density": 72,
  "isProgressive": false,
  "orientation": 1,
  "hasProfile": true,
  "hasExif": true,
  "hasIcc": true,
  "hasXmp": false,
  "bitDepth": "8",
  "pages": 1,
  "histogram": [
    { "channel": "red", "min": 0, "max": 255, "mean": 128.45, "stdev": 52.31 },
    { "channel": "green", "min": 2, "max": 253, "mean": 115.22, "stdev": 48.76 },
    { "channel": "blue", "min": 0, "max": 250, "mean": 102.89, "stdev": 55.14 }
  ]
}

回應欄位

欄位型別說明
filenamestring已清理的檔名
fileSizenumber檔案大小(位元組)
widthnumber圖片寬度(像素)
heightnumber圖片高度(像素)
formatstring偵測到的格式(jpeg、png、webp 等)
channelsnumber色彩通道數
hasAlphaboolean圖片是否具有 alpha 通道
colorSpacestring色彩空間(srgb、cmyk 等)
densitynumber 或 nullDPI/PPI 解析度
isProgressivebooleanJPEG 是否使用漸進式編碼
orientationnumber 或 nullEXIF 方向值(1-8)
hasProfileboolean是否嵌入了 ICC 描述檔
hasExifboolean是否存在 EXIF 中繼資料
hasIccboolean是否存在 ICC 色彩描述檔
hasXmpboolean是否存在 XMP 中繼資料
bitDepthstring 或 null每個取樣的位元數
pagesnumber頁數(適用於 TIFF、GIF 等多頁格式)
histogramarray各通道統計(最小值、最大值、平均值、標準差)

注意事項

  • 這是唯讀端點。它不會產生可下載的輸出檔案或 jobId
  • 對於 RAW 格式圖片(DNG、CR2、NEF、ARW 等),會使用 ExifTool 擷取 Sharp 無法直接讀取的真實感光元件尺寸與中繼資料旗標。
  • HEIC/HEIF 檔案會在內部解碼為 PNG 以擷取像素統計,因為 Sharp 無法解碼 HEVC 像素。
  • 色階分布提供各通道的最小值/最大值/平均值/標準差,而非完整的 256 格分布。
  • density 欄位反映嵌入的 DPI 中繼資料(若存在)。