LoginSignup
1
1

More than 3 years have passed since last update.

【JavaScript】画像のファイルタイプをバイナリレベルで判別する方法

Posted at

リンク

こちらを参考
すごく勉強になりました。

概要

  1. readAsArrayBufferでバイナリに変更
  2. Uint8Arrayを使って変換 new Uint8Array(binary)
  3. 初めの10個分を読む
  4. 1文字ずつ16進数列に変換 toString(16)
  5. 変換した文字列がどの画像形式か判別する
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1