Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: eb8ebc56f181195caa21aee5994540ccd8171643
https://github.com/WebKit/WebKit/commit/eb8ebc56f181195caa21aee5994540ccd8171643
Author: Said Abou-Hallawa <[email protected]>
Date: 2026-04-16 (Thu, 16 Apr 2026)
Changed paths:
M Source/WebCore/Headers.cmake
M Source/WebCore/WebCore.xcodeproj/project.pbxproj
M Source/WebCore/platform/graphics/BitmapImage.h
M Source/WebCore/platform/graphics/BitmapImageDescriptor.cpp
M Source/WebCore/platform/graphics/BitmapImageDescriptor.h
M Source/WebCore/platform/graphics/BitmapImageSource.h
M Source/WebCore/platform/graphics/ImageDecoder.h
M Source/WebCore/platform/graphics/ImageFrame.h
M Source/WebCore/platform/graphics/ImageSource.h
M Source/WebCore/platform/graphics/ImageUtilities.h
M Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp
M Source/WebCore/platform/graphics/cg/ImageDecoderCG.h
M Source/WebCore/platform/graphics/cg/ImageUtilitiesCG.cpp
M Source/WebKit/Scripts/webkit/opaque_ipc_types.tracking.in
M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
M Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
M Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm
M Source/WebKit/UIProcess/WebPageProxy.h
M Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm
M Source/WebKit/WebProcess/WebPage/WebPage.h
M Source/WebKit/WebProcess/WebPage/WebPage.messages.in
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/LoadAndDecodeImage.mm
Log Message:
-----------
Add an SPI in WKWebView which retrieves image metadata from image data
https://bugs.webkit.org/show_bug.cgi?id=312425
rdar://173955537
Reviewed by Tim Horton.
The SPI getImageMetadata will use the WebContent process to decode the image
data and retrieve the size, the density and the frame count of the image.
Test: Tools/TestWebKitAPI/Tests/WebKitCocoa/LoadAndDecodeImage.mm
* Source/WebCore/Headers.cmake:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/platform/graphics/BitmapImage.h:
* Source/WebCore/platform/graphics/BitmapImageDescriptor.cpp:
(WebCore::BitmapImageDescriptor::density const):
* Source/WebCore/platform/graphics/BitmapImageDescriptor.h:
* Source/WebCore/platform/graphics/BitmapImageSource.h:
* Source/WebCore/platform/graphics/ImageDecoder.h:
(WebCore::ImageDecoder::frameDensityAtIndex const):
* Source/WebCore/platform/graphics/ImageFrame.h:
(WebCore::ImageFrame::setDensity):
(WebCore::ImageFrame::density const):
* Source/WebCore/platform/graphics/ImageSource.h:
(WebCore::ImageSource::density const):
* Source/WebCore/platform/graphics/ImageUtilities.h:
* Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::frameDensityFromProperties):
(WebCore::mayHaveDensityCorrectedSize):
(WebCore::ImageDecoderCG::frameDensityAtIndex const):
(WebCore::ImageDecoderCG::fetchFrameMetaDataAtIndex const):
* Source/WebCore/platform/graphics/cg/ImageDecoderCG.h:
* Source/WebCore/platform/graphics/cg/ImageUtilitiesCG.cpp:
(WebCore::imageMetadataFromImageData):
* Source/WebKit/Scripts/webkit/opaque_ipc_types.tracking.in:
* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _getImageMetadata:completionHandler:]):
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:
* Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::getInformationFromImageData):
(WebKit::WebPageProxy::getImageMetadata):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::getImageMetadata):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/LoadAndDecodeImage.mm:
(TestWebKitAPI::TEST(WebKit, GetImageMetadata)):
Canonical link: https://commits.webkit.org/311414@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications