⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 286011 in webkit


Ignore:
Timestamp:
Nov 18, 2021, 10:05:05 AM (5 years ago)
Author:
yoshiaki.jitsukawa@sony.com
Message:

Implement JPEG XL image decoder using libjxl
https://bugs.webkit.org/show_bug.cgi?id=233113

Reviewed by Michael Catanzaro.

This patch introduces the initial version of JPEG XL image decoder.
JPEG XL is a royalty-free raster-graphics file format that supports
both lossy and lossless compression and is experimentally supported by
Chrome, FireFox, and Edge.
The image decoder implemented by this patch uses libjxl, a reference
implementation of JPEG XL decoder (and encoder). JPEG XL animations
will be supported later.

.:

  • Source/cmake/FindJPEGXL.cmake: Added.
  • Source/cmake/OptionsWinCairo.cmake: Enable JPEG XL support if

libjxl is available.

Source/WebCore:

Tests: LayoutTests\fast\images\jpegxl-as-image.html

LayoutTests\fast\images\jpegxl-image-decoding.html

  • platform/ImageDecoders.cmake: Add JPEGXLImageDecoder.cpp if

USE(JPEGXL) is turned on.

  • platform/MIMETypeRegistry.cpp: JPEG XL mime type added.
  • platform/image-decoders/ScalableImageDecoder.cpp: JPEG XL signature

added.

  • platform/image-decoders/jpegxl/JPEGXLImageDecoder.cpp: Added.
  • platform/image-decoders/jpegxl/JPEGXLImageDecoder.h: Added.
  • platform/win/MIMETypeRegistryWin.cpp: The .jxl file extension added.

LayoutTests:

  • TestExpectations: Skip JPEG XL tests by default.
  • fast/images/jpegxl-as-image-expected.html: Added.
  • fast/images/jpegxl-as-image.html: Added.
  • fast/images/jpegxl-image-decoding-expected.txt: Added.
  • fast/images/jpegxl-image-decoding.html: Added.
  • fast/images/resources/green-313x313.jxl: Added.
  • platform/wincairo/TestExpectations: Skip JPEG XL tests until

WebKitReqirements release with libjxl.

Location:
trunk
Files:
9 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r285950 r286011  
     12021-11-18  Yoshiaki Jitsukawa  <yoshiaki.jitsukawa@sony.com>
     2
     3        Implement JPEG XL image decoder using libjxl
     4        https://bugs.webkit.org/show_bug.cgi?id=233113
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        This patch introduces the initial version of JPEG XL image decoder.
     9        JPEG XL is a royalty-free raster-graphics file format that supports
     10        both lossy and lossless compression and is experimentally supported by
     11        Chrome, FireFox, and Edge.
     12        The image decoder implemented by this patch uses libjxl, a reference
     13        implementation of JPEG XL decoder (and encoder). JPEG XL animations
     14        will be supported later.
     15
     16        * Source/cmake/FindJPEGXL.cmake: Added.
     17        * Source/cmake/OptionsWinCairo.cmake: Enable JPEG XL support if
     18        libjxl is available.
     19
    1202021-11-17  Patrick Angle  <pangle@apple.com>
    221
  • trunk/LayoutTests/ChangeLog

    r286002 r286011  
     12021-11-18  Yoshiaki Jitsukawa  <yoshiaki.jitsukawa@sony.com>
     2
     3        Implement JPEG XL image decoder using libjxl
     4        https://bugs.webkit.org/show_bug.cgi?id=233113
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        This patch introduces the initial version of JPEG XL image decoder.
     9        JPEG XL is a royalty-free raster-graphics file format that supports
     10        both lossy and lossless compression and is experimentally supported by
     11        Chrome, FireFox, and Edge.
     12        The image decoder implemented by this patch uses libjxl, a reference
     13        implementation of JPEG XL decoder (and encoder). JPEG XL animations
     14        will be supported later.
     15
     16        * TestExpectations: Skip JPEG XL tests by default.
     17        * fast/images/jpegxl-as-image-expected.html: Added.
     18        * fast/images/jpegxl-as-image.html: Added.
     19        * fast/images/jpegxl-image-decoding-expected.txt: Added.
     20        * fast/images/jpegxl-image-decoding.html: Added.
     21        * fast/images/resources/green-313x313.jxl: Added.
     22        * platform/wincairo/TestExpectations: Skip JPEG XL tests until
     23        WebKitReqirements release with libjxl.
     24
    1252021-11-18  Martin Robinson  <mrobinson@webkit.org>
    226
  • trunk/LayoutTests/TestExpectations

    r286002 r286011  
    132132fast/images/animated-avif.html [ Skip ]
    133133http/tests/images/avif-partial-load-crash.html [ Skip ]
     134
     135# These tests don't have to be platform-specific, but they are only implemented on WinCairo now.
     136fast/images/jpegxl-image-decoding.html [ Skip ]
     137fast/images/jpegxl-as-image.html [ Skip ]
    134138
    135139# Only applicable on platforms with dark mode support
  • trunk/LayoutTests/platform/wincairo/TestExpectations

    r285097 r286011  
    273273fast/layers/prevent-hit-test-during-layout.html [ Skip ]
    274274
    275 
     275# JPEG XL is disabled until WebKitRequirements is released with libjxl
     276fast/images/jpegxl-as-image.html [ Skip ]
     277fast/images/jpegxl-image-decoding.html [ Skip ]
    276278
    277279# DataTransferItems is not yet implemented
  • trunk/Source/WebCore/ChangeLog

    r286001 r286011  
     12021-11-18  Yoshiaki Jitsukawa  <yoshiaki.jitsukawa@sony.com>
     2
     3        Implement JPEG XL image decoder using libjxl
     4        https://bugs.webkit.org/show_bug.cgi?id=233113
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        This patch introduces the initial version of JPEG XL image decoder.
     9        JPEG XL is a royalty-free raster-graphics file format that supports
     10        both lossy and lossless compression and is experimentally supported by
     11        Chrome, FireFox, and Edge.
     12        The image decoder implemented by this patch uses libjxl, a reference
     13        implementation of JPEG XL decoder (and encoder). JPEG XL animations
     14        will be supported later.
     15
     16        Tests: LayoutTests\fast\images\jpegxl-as-image.html
     17               LayoutTests\fast\images\jpegxl-image-decoding.html
     18
     19        * platform/ImageDecoders.cmake: Add JPEGXLImageDecoder.cpp if
     20        USE(JPEGXL) is turned on.
     21        * platform/MIMETypeRegistry.cpp: JPEG XL mime type added.
     22        * platform/image-decoders/ScalableImageDecoder.cpp: JPEG XL signature
     23        added.
     24        * platform/image-decoders/jpegxl/JPEGXLImageDecoder.cpp: Added.
     25        * platform/image-decoders/jpegxl/JPEGXLImageDecoder.h: Added.
     26        * platform/win/MIMETypeRegistryWin.cpp: The .jxl file extension added.
     27
    1282021-11-18  Alan Bujtas  <zalan@apple.com>
    229
  • trunk/Source/WebCore/platform/ImageDecoders.cmake

    r276238 r286011  
    77    "${WEBCORE_DIR}/platform/image-decoders/jpeg"
    88    "${WEBCORE_DIR}/platform/image-decoders/jpeg2000"
     9    "${WEBCORE_DIR}/platform/image-decoders/jpegxl"
    910    "${WEBCORE_DIR}/platform/image-decoders/png"
    1011    "${WEBCORE_DIR}/platform/image-decoders/webp"
     
    3031    platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.cpp
    3132
     33    platform/image-decoders/jpegxl/JPEGXLImageDecoder.cpp
     34
    3235    platform/image-decoders/png/PNGImageDecoder.cpp
    3336
     
    5154endif ()
    5255
     56if (JPEGXL_FOUND)
     57    list(APPEND WebCore_LIBRARIES JPEGXL::jxl)
     58endif ()
     59
    5360if (USE_CAIRO)
    5461    list(APPEND WebCore_SOURCES
  • trunk/Source/WebCore/platform/MIMETypeRegistry.cpp

    r285936 r286011  
    111111#if !USE(CG) && USE(OPENJPEG)
    112112    "image/jpeg2000",
     113#endif
     114#if USE(JPEGXL)
     115    "image/jxl",
    113116#endif
    114117#if PLATFORM(IOS_FAMILY)
  • trunk/Source/WebCore/platform/image-decoders/ScalableImageDecoder.cpp

    r278338 r286011  
    3939#if USE(WEBP)
    4040#include "WEBPImageDecoder.h"
     41#endif
     42#if USE(JPEGXL)
     43#include "JPEGXLImageDecoder.h"
    4144#endif
    4245
     
    108111#endif
    109112
     113#if USE(JPEGXL)
     114bool matchesJPEGXLSignature(const uint8_t* contents, size_t length)
     115{
     116    JxlSignature signature = JxlSignatureCheck(contents, length);
     117    return signature != JXL_SIG_NOT_ENOUGH_BYTES && signature != JXL_SIG_INVALID;
     118}
     119#endif
     120
    110121bool matchesBMPSignature(char* contents)
    111122{
     
    161172    if (matchesWebPSignature(contents))
    162173        return WEBPImageDecoder::create(alphaOption, gammaAndColorProfileOption);
     174#endif
     175
     176#if USE(JPEGXL)
     177    if (matchesJPEGXLSignature(reinterpret_cast<const uint8_t*>(contents), length))
     178        return JPEGXLImageDecoder::create(alphaOption, gammaAndColorProfileOption);
    163179#endif
    164180
  • trunk/Source/WebCore/platform/win/MIMETypeRegistryWin.cpp

    r263923 r286011  
    100100        mimetypeMap.add("wmlc", "application/vnd.wap.wmlc");
    101101        mimetypeMap.add("m4a", "audio/x-m4a");
     102#if USE(JPEGXL)
     103        mimetypeMap.add("jxl", "image/jxl");
     104#endif
    102105    }
    103106    String result = mimetypeMap.get(ext);
  • trunk/Source/cmake/OptionsWinCairo.cmake

    r285734 r286011  
    2525if (LCMS2_FOUND)
    2626    SET_AND_EXPOSE_TO_BUILD(USE_LCMS ON)
     27endif ()
     28
     29find_package(JPEGXL)
     30if (JPEGXL_FOUND)
     31    SET_AND_EXPOSE_TO_BUILD(USE_JPEGXL ON)
    2732endif ()
    2833
Note: See TracChangeset for help on using the changeset viewer.