Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7ca87096bd024ce32d7bfe87e86883db12a145fa
      
https://github.com/WebKit/WebKit/commit/7ca87096bd024ce32d7bfe87e86883db12a145fa
  Author: Tim Horton <[email protected]>
  Date:   2024-07-10 (Wed, 10 Jul 2024)

  Changed paths:
    M Source/WebCore/platform/graphics/DestinationColorSpace.cpp
    M Source/WebCore/platform/graphics/DestinationColorSpace.h
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/LoadAndDecodeImage.mm

  Log Message:
  -----------
  WKWebView _loadAndDecodeImage's maximum size parameter crops the image 
instead of scaling it
https://bugs.webkit.org/show_bug.cgi?id=276384
rdar://131406675

Reviewed by Simon Fraser.

* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::loadAndDecodeImage):
The _loadAndDecodeImage method has an optional parameter allowing clients to
choose a maximum size for the image to be scaled into. However, the 
implementation
crops the image into the maximum size, instead of scaling into it. Also, it
currently scales images *up* to fit in the maximum size, instead of leaving
smaller images alone.

Fix both of these issues.

Also, drive-by add a fallback to an sRGB destination in cases where the decoded
image has a colorspace that it is not possible for us to draw into.

Canonical link: https://commits.webkit.org/280823@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to