Skip to content
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

Add MIME Type Definitions for JPEG‑XL Support #627

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

TitikshaBansal
Copy link

@TitikshaBansal TitikshaBansal commented Mar 4, 2025

This pull request introduces new MIME type definitions and conversion rules to enable proper recognition of JPEG‑XL files in cups‑filters. With these changes, CUPS and associated utilities (e.g. cupsfilter) will be able to correctly identify and process JPEG‑XL files based on their content and file extension.

Note: This PR is limited to MIME type contributions only and does not include changes to image decoding or filter implementations.


Changes Overview

MIME Types

  • File Modified: mime/cupsfilters.types
    • Added a new MIME type entry for JPEG‑XL:
    • The rule uses a magic signature check (for both the standard signature and the stream signature) to detect JPEG‑XL files. The priority(150) was added to ensure that this MIME type has a higher priority compared to similar image formats, so that JPEG‑XL files are correctly identified.

MIME Conversion Rules

  • Files Modified: Various conversion files (e.g., cupsfilters-individual.convs, cupsfilters.convs, etc.)
    • Conversion rules have been updated or added to map the new MIME type (image/jxl) to the appropriate filter chains.
    • The changes ensure that JPEG‑XL files follow the same processing workflow as other supported image formats (such as JPEG), allowing for proper conversion to PDF, raster, or other output formats.

Testing and Verification

  • Local Tests:
    • Verified that sample JPEG‑XL files are now correctly identified as image/jxl by checking with MIME detection tools.
    • Ran the cupsfilter utility and confirmed that the new MIME type rules enable proper file detection.
  • Integration: Ensured that the modifications do not disrupt processing of other image formats.

Future Work

  • Further Refinement: Monitor the behavior of the new MIME type rules in various deployment scenarios and refine the signature/magic string checks if needed.
  • Documentation Updates: Update any user or administrator documentation to mention the new support for JPEG‑XL MIME types.
  • Community Feedback: Open to suggestions for improving MIME type definitions based on feedback from the user and developer communities.

Background

This contribution is part of my ongoing work to modernize image format support in cups‑filters. I originally contributed MIME type modifications during the WoC 5.0 event organized by IIIT Kalyani, and I look forward to continuing my contributions to further enhance the project.

GitHub Repository: https://github.com/TitikshaBansal/cups-filters
Branch: features/jpegxl-mime-support


Thank you for your review. I look forward to any feedback and suggestions for further improvements.

Best regards,
Titiksha Bansal

@TitikshaBansal TitikshaBansal changed the title Features/jpegxl support Add JPEG‑XL Support to libcupsfilters Mar 4, 2025
@TitikshaBansal TitikshaBansal changed the title Add JPEG‑XL Support to libcupsfilters Add MIME Type Definitions for JPEG‑XL Support Mar 4, 2025
@@ -91,6 +91,9 @@ image/x-xbitmap xbm string(0,"#define");
image/x-xpixmap xpm string(3,"XPM")
image/x-xwindowdump xwd string(4,<00000007>)
image/urf urf string(0,UNIRAST<00>)
image/jxl jxl string(0,"<0000000C4A584C20>")
image/jxl jxl string(0,"<FF0A>")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should work in one line:

image/jxl       		jxl string(0,"<0000000C4A584C20>") string(0,"<FF0A>")

Each space-separated expression is logically ORed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants