jpeg (74784) | jpeg (75937) |
---|---|
1 2#------------------------------------------------------------------------------ 3# JPEG images 4# SunOS 5.5.1 had 5# 6# 0 string \377\330\377\340 JPEG file 7# 0 string \377\330\377\356 JPG file 8# 9# both of which turn into "JPEG image data" here. 10# 110 beshort 0xffd8 JPEG image data 12>6 string JFIF \b, JFIF standard | 1 2#------------------------------------------------------------------------------ 3# JPEG images 4# SunOS 5.5.1 had 5# 6# 0 string \377\330\377\340 JPEG file 7# 0 string \377\330\377\356 JPG file 8# 9# both of which turn into "JPEG image data" here. 10# 110 beshort 0xffd8 JPEG image data 12>6 string JFIF \b, JFIF standard |
13>6 string Exif \b, EXIF standard |
|
13# The following added by Erik Rossen <rossen@freesurf.ch> 1999-09-06 14# in a vain attempt to add image size reporting for JFIF. Note that these 15# tests are not fool-proof since some perfectly valid JPEGs are currently 16# impossible to specify in magic(4) format. 17# First, a little JFIF version info: 18>11 byte x \b %d. 19>12 byte x \b%02d 20# Next, the resolution or aspect ratio of the image: 21>13 byte 0 \b, aspect ratio 22>13 byte 1 \b, resolution (DPI) 23>13 byte 2 \b, resolution (DPCM) | 14# The following added by Erik Rossen <rossen@freesurf.ch> 1999-09-06 15# in a vain attempt to add image size reporting for JFIF. Note that these 16# tests are not fool-proof since some perfectly valid JPEGs are currently 17# impossible to specify in magic(4) format. 18# First, a little JFIF version info: 19>11 byte x \b %d. 20>12 byte x \b%02d 21# Next, the resolution or aspect ratio of the image: 22>13 byte 0 \b, aspect ratio 23>13 byte 1 \b, resolution (DPI) 24>13 byte 2 \b, resolution (DPCM) |
24>14 beshort x \b, %d x 25>16 beshort x \b %d | |
26#>4 beshort x \b, segment length %d 27# Next, show thumbnail info, if it exists: 28>18 byte !0 \b, thumbnail %dx 29>>19 byte x \b%d 30# Here things get sticky. We can do ONE MORE marker segment with 31# indirect addressing, and that's all. It would be great if we could 32# do pointer arithemetic like in an assembler language. Christos? 33# And if there was some sort of looping construct to do searches, plus a few --- 16 unchanged lines hidden (view full) --- 50>>(4.S+9) beshort x \b%d 51>(4.S+5) byte 0xC2 \b, progressive 52>>(4.S+6) byte x \b, precision %d 53>>(4.S+7) beshort x \b, %dx 54>>(4.S+9) beshort x \b%d 55# I've commented-out quantisation table reporting. I doubt anyone cares yet. 56#>(4.S+5) byte 0xDB \b, quantisation table 57#>>(4.S+6) beshort x \b length=%d | 25#>4 beshort x \b, segment length %d 26# Next, show thumbnail info, if it exists: 27>18 byte !0 \b, thumbnail %dx 28>>19 byte x \b%d 29# Here things get sticky. We can do ONE MORE marker segment with 30# indirect addressing, and that's all. It would be great if we could 31# do pointer arithemetic like in an assembler language. Christos? 32# And if there was some sort of looping construct to do searches, plus a few --- 16 unchanged lines hidden (view full) --- 49>>(4.S+9) beshort x \b%d 50>(4.S+5) byte 0xC2 \b, progressive 51>>(4.S+6) byte x \b, precision %d 52>>(4.S+7) beshort x \b, %dx 53>>(4.S+9) beshort x \b%d 54# I've commented-out quantisation table reporting. I doubt anyone cares yet. 55#>(4.S+5) byte 0xDB \b, quantisation table 56#>>(4.S+6) beshort x \b length=%d |
57>14 beshort x \b, %d x 58>16 beshort x \b %d |
|
58 59# HSI is Handmade Software's proprietary JPEG encoding scheme 600 string hsi1 JPEG image data, HSI proprietary | 59 60# HSI is Handmade Software's proprietary JPEG encoding scheme 610 string hsi1 JPEG image data, HSI proprietary |