Skip to content

Commit d1f6d56

Browse files
Update image-jpeg-xl.c
1 parent 81b8caa commit d1f6d56

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

cupsfilters/image-jpeg-xl.c

+6-9
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
* This function checks for both the JPEG‑XL container signature and the
1414
* JPEG‑XL stream signature.
1515
*/
16-
static int
17-
_cf_is_jpegxl(const unsigned char *header, size_t len)
16+
int
17+
_cfIsJPEGXL(const unsigned char *header, size_t len)
1818
{
1919
if (len < 12)
2020
return 0;
@@ -104,9 +104,6 @@ _cf_image_create_from_jxl_decoder(JxlDecoder *decoder)
104104
img->ysize = (int)basic_info.ysize;
105105
img->xppi = (basic_info.uses_original_profile) ? 300 : 72; // Adjust if necessary
106106
img->yppi = (basic_info.uses_original_profile) ? 300 : 72; // Adjust if necessary
107-
#ifdef HAVE_BITS_PER_COMPONENT
108-
img->bitsPerComponent = (int)basic_info.bits_per_sample;
109-
#endif
110107

111108
/* For JPEG‑XL, we assume the decoded format is RGB. */
112109
img->colorspace = CF_IMAGE_RGB;
@@ -132,7 +129,7 @@ _cf_image_create_from_jxl_decoder(JxlDecoder *decoder)
132129
* Returns 0 on success, nonzero on failure.
133130
*/
134131
int
135-
_cf_image_read_jpegxl(cf_image_t *img, FILE *fp,
132+
_cfImageReadJPEGXL(cf_image_t *img, FILE *fp,
136133
cf_icspace_t primary, cf_icspace_t secondary,
137134
int saturation, int hue, const cf_ib_t *lut)
138135
{
@@ -190,7 +187,7 @@ _cf_image_read_jpegxl(cf_image_t *img, FILE *fp,
190187
}
191188

192189
/* Create an image from the decoder output */
193-
cf_image_t *new_img = _cf_image_create_from_jxl_decoder(decoder);
190+
cf_image_t *new_img = _cfImageReadJPEGXL(decoder);
194191
if (!new_img) {
195192
DEBUG_printf("DEBUG: JPEG‑XL: Failed to create image from decoder data.\n");
196193
JxlDecoderDestroy(decoder);
@@ -216,14 +213,14 @@ _cf_image_read_jpegxl(cf_image_t *img, FILE *fp,
216213
* Returns a pointer to a cf_image_t on success, or NULL on failure.
217214
*/
218215
cf_image_t *
219-
_cf_image_open_jpegxl(FILE *fp, cf_icspace_t primary, cf_icspace_t secondary,
216+
_cfImageOpenJPEGXL(FILE *fp, cf_icspace_t primary, cf_icspace_t secondary,
220217
int saturation, int hue, const cf_ib_t *lut)
221218
{
222219
cf_image_t *img = calloc(1, sizeof(cf_image_t));
223220
if (img == NULL)
224221
return NULL;
225222

226-
if (_cf_image_read_jpegxl(img, fp, primary, secondary, saturation, hue, lut)) {
223+
if (_cfImageReadJPEGXL(img, fp, primary, secondary, saturation, hue, lut)) {
227224
cfImageClose(img);
228225
return NULL;
229226
}

0 commit comments

Comments
 (0)