1 /* This file is part of the coreboot project. */
2 /* SPDX-License-Identifier: GPL-2.0-only */
10 int main(int argc
, char **argv
)
12 FILE *f
= fopen(argv
[1], "rb");
17 if (fseek(f
, 0, SEEK_END
) != 0)
20 if (fseek(f
, 0, SEEK_SET
) != 0)
23 char *buf
= malloc(len
);
24 struct jpeg_decdata
*decdata
= malloc(sizeof(*decdata
));
25 if (fread(buf
, len
, 1, f
) != 1)
31 jpeg_fetch_size(buf
, &width
, &height
);
32 //printf("width: %d, height: %d\n", width, height);
33 char *pic
= malloc(depth
/ 8 * width
* height
);
34 int ret
= jpeg_decode(buf
, pic
, width
, height
, depth
, decdata
);
35 //printf("ret: %x\n", ret);