static byte[] isJPEG_magic = bytesFromHex("FFD8FF"); static bool isJPEG(byte[] data) { ret byteArrayStartsWith(data, isJPEG_magic); } static bool isJPEG(File f) { ret isJPEG(loadBeginningOfBinaryFile(f, l(isJPEG_magic))); }
Began life as a copy of #1004676
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1009031 |
| Snippet name: | isJPEG - tests using magic bytes |
| Eternal ID of this version: | #1009031/4 |
| Text MD5: | b0d2164db37bc5af9c01c1850a8092f3 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2022-08-15 20:41:18 |
| Source code size: | 237 bytes / 9 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 872 / 939 |
| Version history: | 3 change(s) |
| Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1010493 - isGZ #1015945 - isJPEGFile #1015994 - isGIF #1020141 - isJAR (same as zip) #1032430 - isWAVByContent ("RIFF") #1033454 - isNonEmptySingleZip_byMagicHeader #1035940 - isQOI - tests using magic bytes |