-
Notifications
You must be signed in to change notification settings - Fork 36
Add JPEG‑XL Support to libcupsfilters (WoC 4.0 Contribution) #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
TitikshaBansal
wants to merge
79
commits into
OpenPrinting:master
Choose a base branch
from
TitikshaBansal:features/jpegxl-support
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add JPEG‑XL Support to libcupsfilters (WoC 4.0 Contribution) #82
TitikshaBansal
wants to merge
79
commits into
OpenPrinting:master
from
TitikshaBansal:features/jpegxl-support
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Added an inclusion of your new header for JPEG‑XL support.
In the block that checks the header for PNG, JPEG, and TIFF, added a new branch for JPEG‑XL. We add an #ifdef HAVE_LIBJXL branch that calls _cfImageReadJPEGXL() if is_jpegxl() returns true. Now, whether the user is converting to PDF (via imagetopdf.c) or to Raster (via imagetoraster.c), they call cfImageOpen() (and thus cfImageOpenFP()) which now supports JPEG‑XL.
Created a header file for your JPEG‑XL functions.
Implemented the JPEG‑XL–specific functions. In this the extra parameters (primary, secondary, saturation, hue, lut) are passed but not used because the JPEG‑XL decoder (via libjxl) handles the uncompression and preserves full quality.
Implementation for cfImageCreateFromJxlDecoder(). This function uses the libjxl API to extract the frame header, compute the required output buffer size (requesting 16‑bit output for full quality), allocate memory for the decoded pixels, and then fill in a cf_image_t structure with the image properties.
Reverted the changes made earlier in the file.
Reverted all the changes made earlier.
Updated file to handle the errors encountered while make.
Made changes to handle errors during make
Updated file to handle errors encountered while make
What is now missing is:
Please always test-build after each code change!! |
updated the function names for the jpeg-xl support
fixed some debug errors.
Changed comment styling to align with OpenPrinting's code style.
cupsfilters/image.c
Outdated
@@ -71,7 +78,7 @@ cfImageClose(cf_image_t *img) // I - Image to close | |||
close(img->cachefile); | |||
unlink(img->cachename); | |||
} | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure not having any whitespace-only changes.
Thank you very much!
|
Modified code to ensure that libjxl library is installed for CI testing.
Added header, copyrights and contents comments in the file
Added necessary comments in the file
Modified the copyright comments.
Applied a patch to unblock 16-bit-per-color output.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add JPEG‑XL Support to libcupsfilters
This pull request adds initial support for the JPEG‑XL image format to libcupsfilters. With these changes, cups‑filters can now detect, decode, and convert JPEG‑XL files into PDF and raster formats, thereby enabling printing via CUPS.
Overview
JPEG‑XL Detection
is_jpegxl()
inimage-jpeg-xl.c
. Checks for both standard JPEG‑XL signature (\x00\x00\x00\x0C\x4A\x58\x4C\x20
) and the JPEG‑XL stream signature (\xFF\x0A
).Decoding Implementation
_cfImageReadJPEGXL()
_cfImageOpenJPEGXL()
cf_image_create_from_jxl_decoder()
JxlPixelFormat
requesting 16‑bit per channel output.fprintf(stderr, ...)
to log file size, status codes, and key variable values for debugging.Build System Updates
pkg-config
to link against libjxl.Testing and Verification
djxl
tool and by testing conversions through cups‑filters.rasterview
to ensure correct color depth and page dimensions.Future Work
Background
This contribution was developed as part of the WoC 4.0 event organized by IIIT Kalyani. I have enjoyed working on integrating JPEG‑XL support into cups‑filters and am eager to continue contributing to this project even after the event concludes.
GitHub Repository: https://github.com/TitikshaBansal/libcupsfilters
Branch:
features/jpegxl-support
Thank you for reviewing my contribution. I look forward to your feedback and further improvements.
Best regards,
Titiksha Bansal