From 9283e76f1abbeecb10dd087e982d831ae9bd0733 Mon Sep 17 00:00:00 2001 From: qiqi Date: Tue, 17 Nov 2026 21:05:26 +0800 Subject: [PATCH] =?UTF-8?q?chore(plugins):=20=E5=90=8C=E6=AD=A5=E6=A0=87?= =?UTF-8?q?=E6=B3=A8=E6=8F=92=E4=BB=B6=201.20.6=EF=BC=88=E5=8F=8D=E7=99=BD?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/index.json | 6 ++-- ... => plugin-image-annotate.7a865c7c353c.js} | 34 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) rename plugins/runtime/{plugin-image-annotate.2a8b070e9150.js => plugin-image-annotate.7a865c7c353c.js} (99%) diff --git a/plugins/index.json b/plugins/index.json index c82289d..fedad1e 100644 --- a/plugins/index.json +++ b/plugins/index.json @@ -13,9 +13,9 @@ }, { "id": "image-annotate", - "file": "plugin-image-annotate.2a8b070e9150.js", - "version": "1.20.5", - "integrity": "sha256-KosHDpFQs910KPsW1G91hhLX58Xh9oWcvyb8tbmYqnM=" + "file": "plugin-image-annotate.7a865c7c353c.js", + "version": "1.20.6", + "integrity": "sha256-eoZcfDU8P7yqxVGorrWs0b9iTKJfEE25b85JPDCEsk8=" }, { "id": "image-vectorize", diff --git a/plugins/runtime/plugin-image-annotate.2a8b070e9150.js b/plugins/runtime/plugin-image-annotate.7a865c7c353c.js similarity index 99% rename from plugins/runtime/plugin-image-annotate.2a8b070e9150.js rename to plugins/runtime/plugin-image-annotate.7a865c7c353c.js index 8bc1a13..689a839 100644 --- a/plugins/runtime/plugin-image-annotate.2a8b070e9150.js +++ b/plugins/runtime/plugin-image-annotate.7a865c7c353c.js @@ -9,7 +9,7 @@ var __IWB_ANNOTATE_MANIFEST__ = { id: 'image-annotate', name: '标注 / 修图', - version: '1.20.5', + version: '1.20.6', apiVersion: 1, capabilities: ['commands', 'nodeActions', 'canvas', 'canvasWrite'], settings: { @@ -3901,29 +3901,16 @@ var __IWB_ANNOTATE_MANIFEST__ = { render: (canvas, v) => { if (v <= 0) return; const k = v / 100; - if (!FILTER_SUPPORTED) { - const bright = 1 + 0.4 * k, contrast = 1 + 0.25 * k, sat = 1 + 0.2 * k; - mapPixels(canvas, (r, g, b) => { - const y = luma(r, g, b); - const out = [r, g, b].map((c) => { - let v2 = y + (c - y) * sat; - v2 = (v2 - 128) * contrast + 128; - return clamp255(v2 * bright); - }); - return out; - }); - return; - } if (FILTER_SUPPORTED) { filterCanvas(canvas, "invert(" + k + ")"); return; } - const okInv = mapPixels(canvas, (r, g, b) => [ + const ok = mapPixels(canvas, (r, g, b) => [ clamp255(r + (255 - 2 * r) * k), clamp255(g + (255 - 2 * g) * k), clamp255(b + (255 - 2 * b) * k) ]); - if (!okInv) blendFallback(canvas, "invert", k); + if (!ok) blendFallback(canvas, "invert", k); } }, gray: { @@ -3961,7 +3948,20 @@ var __IWB_ANNOTATE_MANIFEST__ = { render: (canvas, v) => { if (v <= 0) return; const k = v / 100; - filterCanvas(canvas, "brightness(" + (1 + 0.4 * k).toFixed(3) + ") contrast(" + (1 + 0.25 * k).toFixed(3) + ") saturate(" + (1 + 0.2 * k).toFixed(3) + ")"); + if (FILTER_SUPPORTED) { + filterCanvas(canvas, "brightness(" + (1 + 0.4 * k).toFixed(3) + ") contrast(" + (1 + 0.25 * k).toFixed(3) + ") saturate(" + (1 + 0.2 * k).toFixed(3) + ")"); + return; + } + const bright = 1 + 0.4 * k, contrast = 1 + 0.25 * k, sat = 1 + 0.2 * k; + mapPixels(canvas, (r, g, b) => { + const y = luma(r, g, b); + const out = [r, g, b].map((c) => { + let v2 = y + (c - y) * sat; + v2 = (v2 - 128) * contrast + 128; + return clamp255(v2 * bright); + }); + return out; + }); } }, contrast: {