aboutsummaryrefslogtreecommitdiffstats
path: root/src/jpeg.c
diff options
context:
space:
mode:
authoryzrh <yzrh@noema.org>2022-12-25 01:26:05 +0000
committeryzrh <yzrh@noema.org>2022-12-25 01:26:05 +0000
commit288b65a1fd6bcb1908a31c0a3e18ce7b6bf53a89 (patch)
tree03dc0909583f0ee8f9c60e0e629dfe67008995ae /src/jpeg.c
parent9c1f1d0b75de0d2ed299842d3025941f3e681c16 (diff)
downloadmelon-288b65a1fd6bcb1908a31c0a3e18ce7b6bf53a89.tar.gz
melon-288b65a1fd6bcb1908a31c0a3e18ce7b6bf53a89.tar.zst
Handle different JPEG colour component.
Signed-off-by: yzrh <yzrh@noema.org>
Diffstat (limited to 'src/jpeg.c')
-rw-r--r--src/jpeg.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/jpeg.c b/src/jpeg.c
index 4ea4d7f..cdcae7b 100644
--- a/src/jpeg.c
+++ b/src/jpeg.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2021, yzrh <yzrh@noema.org>
+ * Copyright (c) 2020-2022, yzrh <yzrh@noema.org>
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -9,7 +9,7 @@
#include <jpeglib.h>
int
-strinfo_jpeg_dim(int *jpeg_width, int *jpeg_height,
+strinfo_jpeg_dim(int *jpeg_width, int *jpeg_height, int *jpeg_components,
const char * restrict data, int data_size)
{
struct jpeg_decompress_struct cinfo;
@@ -27,6 +27,7 @@ strinfo_jpeg_dim(int *jpeg_width, int *jpeg_height,
*jpeg_width = cinfo.output_width;
*jpeg_height = cinfo.output_height;
+ *jpeg_components = cinfo.output_components;
jpeg_destroy((struct jpeg_common_struct *) &cinfo);