From 075215f40df65a50137561a2c1fe0c5a1daf4875 Mon Sep 17 00:00:00 2001 From: Yannis Guyon Date: Fri, 1 Apr 2022 14:05:38 +0000 Subject: [PATCH] WebPShop 0.4.3 Fix the Preview applying the color profile with no ICC on Windows. --- README.md | 8 ++++---- docs/NEWS.md | 7 +++++++ mac/Info.plist | 4 ++-- mac/WebPShopUI_mac.mm | 2 +- mac/webpshop.xcodeproj/project.pbxproj | 2 +- win/WebPShop.rc | 2 +- win/WebPShopUI_windows.cpp | 11 ++++++++--- 7 files changed, 24 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index e88a7af..fe8638a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # WebP file format plug-in for Photoshop -Current plug-in version: WebPShop 0.4.2 +Current plug-in version: WebPShop 0.4.3 WebPShop is a Photoshop module for opening and saving WebP images, including animations. @@ -17,7 +17,7 @@ using the contents of this repository or contributing. Download the binary at https://github.com/webmproject/WebPShop/releases. \ Direct link for Windows x64: -https://github.com/webmproject/WebPShop/releases/download/v0.4.2/WebPShop_0_4_2_Win_x64.8bi \ +https://github.com/webmproject/WebPShop/releases/download/v0.4.3/WebPShop_0_4_3_Win_x64.8bi \ Direct link for MacOS (extract the ZIP archive afterwise): https://github.com/webmproject/WebPShop/releases/download/v0.4.2/WebPShop_0_4_2_Mac_Universal.zip \ Move the plug-in (the .8bi binary for Windows or the .plugin folder for MacOS) @@ -80,8 +80,8 @@ The radio buttons offer several levels of compression effort: * On some images, lossless compression might produce smaller file sizes than lossy. That's why the quality slider is not linear. The same problem exists with the radio buttons controlling the compression effort. -* The color profile is always applied to the Preview image on Windows and - never applied on macOS, regardless of the related checkbox state. +* The color profile is not applied to the Preview image on macOS, regardless + of the related checkbox state. * This plug-in does not extend `Export As` neither `Save for Web`. * Encoding and decoding are done in a single pass. It is not currently possible to cancel such actions, and it might take some time on big images. diff --git a/docs/NEWS.md b/docs/NEWS.md index d701a88..5674709 100644 --- a/docs/NEWS.md +++ b/docs/NEWS.md @@ -90,3 +90,10 @@ * Built with Microsoft Visual Studio Community 2019 16.11.10. * Tested on Windows Server 2016 Datacenter with Photoshop 2022 (v 23.2.0) x64, Release. + +- 2022/04/01: v0.4.3 + + * Fixed the Preview applying the color profile with no ICC on Windows. + * Built with Microsoft Visual Studio Community 2019 16.11.10. + * Tested on Windows Server 2016 Datacenter with Photoshop 2022 + (v 23.2.2) x64, Release. diff --git a/mac/Info.plist b/mac/Info.plist index 59b0996..2ec510d 100755 --- a/mac/Info.plist +++ b/mac/Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType 8BIF CFBundleShortVersionString - 0.4.2 + 0.4.3 CFBundleSignature 8BIM CFBundleVersion - 0.4.2 + 0.4.3 NSHumanReadableCopyright Copyright 2018-2020 Google LLC diff --git a/mac/WebPShopUI_mac.mm b/mac/WebPShopUI_mac.mm index 36ece9f..d67405f 100644 --- a/mac/WebPShopUI_mac.mm +++ b/mac/WebPShopUI_mac.mm @@ -298,7 +298,7 @@ void DoAboutBox(SPPluginRef plugin_ref) { [alert setMessageText:@"About WebPShop"]; [alert setInformativeText: - @"WebPShop 0.4.2\nWebP 1.2.2\nA Photoshop plug-in for reading " + @"WebPShop 0.4.3\nWebP 1.2.2\nA Photoshop plug-in for reading " @"and writing WebP files.\nCopyright 2019-2022 Google LLC."]; [alert setAlertStyle:NSAlertStyleInformational]; diff --git a/mac/webpshop.xcodeproj/project.pbxproj b/mac/webpshop.xcodeproj/project.pbxproj index 1ae5b2d..b634293 100644 --- a/mac/webpshop.xcodeproj/project.pbxproj +++ b/mac/webpshop.xcodeproj/project.pbxproj @@ -524,7 +524,7 @@ INSTALL_PATH = "$(HOME)/Library/Bundles"; LIBRARY_SEARCH_PATHS = "../libwebp-1.2.1-mac-10.15/lib"; MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 0.4.2; + MARKETING_VERSION = 0.4.3; OTHER_LDFLAGS = "-v"; PLUGIN_TYPE = 8BIF; PRODUCT_BUNDLE_IDENTIFIER = com.google.WebPShop; diff --git a/win/WebPShop.rc b/win/WebPShop.rc index 6387041..693906d 100644 --- a/win/WebPShop.rc +++ b/win/WebPShop.rc @@ -102,7 +102,7 @@ FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "OK",1,171,7,11,14,NOT WS_VISIBLE | WS_DISABLED PUSHBUTTON "Cancel",2,172,24,10,14,NOT WS_VISIBLE | WS_DISABLED - LTEXT "WebPShop 0.4.2\nWebP 1.2.2\nA Photoshop plug-in for reading and writing WebP files.\nCopyright 2019-2022 Google LLC.",5,10,10,180,50 + LTEXT "WebPShop 0.4.3\nWebP 1.2.2\nA Photoshop plug-in for reading and writing WebP files.\nCopyright 2019-2022 Google LLC.",5,10,10,180,50 PUSHBUTTON "developers.google.com/speed/webp",10,10,60,180,20 END diff --git a/win/WebPShopUI_windows.cpp b/win/WebPShopUI_windows.cpp index cb9c2a8..deebe35 100644 --- a/win/WebPShopUI_windows.cpp +++ b/win/WebPShopUI_windows.cpp @@ -156,9 +156,9 @@ bool WebPShopDialog::DisplayImage(const ImageMemoryDesc& image, return false; } - PSPixelMap pixels; - PSPixelMask mask; - pixels.version = 1; + PSPixelMask mask = {}; + PSPixelMap pixels = {}; + pixels.version = 3; pixels.bounds.left = 0; pixels.bounds.right = image.width; pixels.bounds.top = 0; @@ -173,6 +173,11 @@ bool WebPShopDialog::DisplayImage(const ImageMemoryDesc& image, pixels.masks = NULL; pixels.maskPhaseRow = 0; pixels.maskPhaseCol = 0; + pixels.pixelOverlays = NULL; + pixels.colorManagementOptions = write_config_.keep_color_profile + ? kViewAsStandardRGB + : kViewAsUncompensated; + pixels.depth = image.pixels.depth; if (image.num_channels == 4) { mask.next = NULL;