Skip to content
/ fq Public
forked from wader/fq

Commit 9e58067

Browse files
committed
webp: Refactor to use riff code and decode VP8X, EXIF, ICCP and XMP chunks
1 parent 7c8fa05 commit 9e58067

File tree

10 files changed

+1296
-1090
lines changed

10 files changed

+1296
-1090
lines changed

doc/formats.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
|`vpx_ccr` |VPX&nbsp;Codec&nbsp;Configuration&nbsp;Record |<sub></sub>|
123123
|[`wasm`](#wasm) |WebAssembly&nbsp;Binary&nbsp;Format |<sub></sub>|
124124
|`wav` |WAV&nbsp;file |<sub>`id3v2` `id3v1` `id3v11`</sub>|
125-
|`webp` |WebP&nbsp;image |<sub>`vp8_frame`</sub>|
125+
|`webp` |WebP&nbsp;image |<sub>`exif` `vp8_frame` `icc_profile` `xml`</sub>|
126126
|[`xml`](#xml) |Extensible&nbsp;Markup&nbsp;Language |<sub></sub>|
127127
|`yaml` |YAML&nbsp;Ain't&nbsp;Markup&nbsp;Language |<sub></sub>|
128128
|[`zip`](#zip) |ZIP&nbsp;archive |<sub>`probe`</sub>|

doc/formats.svg

Lines changed: 1011 additions & 987 deletions
Loading

format/all/all.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ import (
5858
_ "github.com/wader/fq/format/vorbis"
5959
_ "github.com/wader/fq/format/vpx"
6060
_ "github.com/wader/fq/format/wasm"
61-
_ "github.com/wader/fq/format/webp"
6261
_ "github.com/wader/fq/format/xml"
6362
_ "github.com/wader/fq/format/yaml"
6463
_ "github.com/wader/fq/format/zip"
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
# convert -size 4x4 "xc:#000" 4x4.webp
22
$ fq -d webp dv 4x4.webp
33
|00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f|0123456789abcdef|.{}: 4x4.webp (webp) 0x0-0x2c (44)
4-
0x00|52 49 46 46 |RIFF | riff_id: "RIFF" (valid) 0x0-0x4 (4)
5-
0x00| 24 00 00 00 | $... | riff_length: 36 0x4-0x8 (4)
6-
0x00| 57 45 42 50 | WEBP | webp_id: "WEBP" (valid) 0x8-0xc (4)
7-
| | | image{}: 0xc-0x2c (32)
8-
0x00| 56 50 38 20| VP8 | id: "VP8" 0xc-0x10 (4)
9-
0x10|18 00 00 00 |.... | size: 24 0x10-0x14 (4)
10-
| | | tag{}: 0x14-0x17 (3)
11-
0x10| 30 | 0 | first_part_size0: 1 0x14-0x14.3 (0.3)
12-
0x10| 30 | 0 | show_frame: 1 0x14.3-0x14.4 (0.1)
13-
0x10| 30 | 0 | version: 0 0x14.4-0x14.7 (0.3)
14-
0x10| 30 | 0 | frame_type: "key_frame" (false) 0x14.7-0x15 (0.1)
15-
0x10| 01 00 | .. | first_part_size1: 1 0x15-0x17 (2)
16-
| | | first_part_size: 9
17-
| | | reconstruction: "Bicubic"
18-
| | | loop: "Normal"
19-
0x10| 9d 01 2a | ..* | start_code: 0x9d012a (valid) 0x17-0x1a (3)
20-
0x10| 04 | . | width0: 4 0x1a-0x1b (1)
21-
0x10| 00 | . | horizontal_scale: 0 0x1b-0x1b.2 (0.2)
22-
0x10| 00 | . | width1: 0 0x1b.2-0x1c (0.6)
23-
| | | width: 4
24-
0x10| 04 | . | height0: 4 0x1c-0x1d (1)
25-
0x10| 00 | . | vertical_scale: 0 0x1d-0x1d.2 (0.2)
26-
0x10| 00 | . | height1: 0 0x1d.2-0x1e (0.6)
27-
| | | height: 4
28-
0x10| 02 00| ..| data: raw bits 0x1e-0x2c (14)
4+
0x00|52 49 46 46 |RIFF | id: "RIFF" 0x0-0x4 (4)
5+
0x00| 24 00 00 00 | $... | size: 36 0x4-0x8 (4)
6+
0x00| 57 45 42 50 | WEBP | format: "WEBP" (valid) 0x8-0xc (4)
7+
| | | chunks[0:1]: 0xc-0x2c (32)
8+
| | | [0]{}: chunk 0xc-0x2c (32)
9+
0x00| 56 50 38 20| VP8 | id: "VP8 " 0xc-0x10 (4)
10+
0x10|18 00 00 00 |.... | size: 24 0x10-0x14 (4)
11+
| | | tag{}: 0x14-0x17 (3)
12+
0x10| 30 | 0 | first_part_size0: 1 0x14-0x14.3 (0.3)
13+
0x10| 30 | 0 | show_frame: 1 0x14.3-0x14.4 (0.1)
14+
0x10| 30 | 0 | version: 0 0x14.4-0x14.7 (0.3)
15+
0x10| 30 | 0 | frame_type: "key_frame" (false) 0x14.7-0x15 (0.1)
16+
0x10| 01 00 | .. | first_part_size1: 1 0x15-0x17 (2)
17+
| | | first_part_size: 9
18+
| | | reconstruction: "Bicubic"
19+
| | | loop: "Normal"
20+
0x10| 9d 01 2a | ..* | start_code: 0x9d012a (valid) 0x17-0x1a (3)
21+
0x10| 04 | . | width0: 4 0x1a-0x1b (1)
22+
0x10| 00 | . | horizontal_scale: 0 0x1b-0x1b.2 (0.2)
23+
0x10| 00 | . | width1: 0 0x1b.2-0x1c (0.6)
24+
| | | width: 4
25+
0x10| 04 | . | height0: 4 0x1c-0x1d (1)
26+
0x10| 00 | . | vertical_scale: 0 0x1d-0x1d.2 (0.2)
27+
0x10| 00 | . | height1: 0 0x1d.2-0x1e (0.6)
28+
| | | height: 4
29+
0x10| 02 00| ..| data: raw bits 0x1e-0x2c (14)
2930
0x20|34 25 a4 00 03 70 00 fe fb fd 50 00| |4%...p....P.| |

0 commit comments

Comments
 (0)