1 /* SPDX-License-Identifier: GPL-2.0-only */
9 int main(int argc
, char **argv
)
11 FILE *f
= fopen(argv
[1], "rb");
16 if (fseek(f
, 0, SEEK_END
) != 0)
19 if (fseek(f
, 0, SEEK_SET
) != 0)
22 char *buf
= malloc(len
);
23 struct jpeg_decdata
*decdata
= malloc(sizeof(*decdata
));
24 if (fread(buf
, len
, 1, f
) != 1)
30 jpeg_fetch_size(buf
, &width
, &height
);
31 //printf("width: %d, height: %d\n", width, height);
32 char *pic
= malloc(depth
/ 8 * width
* height
);
33 int ret
= jpeg_decode(buf
, pic
, width
, height
, depth
, decdata
);
34 //printf("ret: %x\n", ret);