From a54241ba8902a37e81b560790f73899ad00bd050 Mon Sep 17 00:00:00 2001 From: qxo <49526356@qq.com> Date: Sat, 12 Dec 2020 11:29:18 +0800 Subject: [PATCH] fix: change display colour depth incorrect from exception to warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cause: my some customer env's remote desktop bitDepth=24, and I can not change it --- src/main/java/com/aimmac23/node/RobotScreenshotSource.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/aimmac23/node/RobotScreenshotSource.java b/src/main/java/com/aimmac23/node/RobotScreenshotSource.java index 91fc702..e8aaf78 100644 --- a/src/main/java/com/aimmac23/node/RobotScreenshotSource.java +++ b/src/main/java/com/aimmac23/node/RobotScreenshotSource.java @@ -8,13 +8,17 @@ import java.awt.image.BufferedImage; import java.awt.image.ColorModel; import java.awt.image.DataBufferInt; +import java.util.logging.Logger; +import com.aimmac23.hub.videostorage.LocalFileVideoStore; import com.aimmac23.node.jna.EncoderInterface; import com.aimmac23.node.jna.JnaLibraryLoader; import com.sun.jna.Pointer; public class RobotScreenshotSource implements ScreenshotSource { + private static final Logger log = Logger.getLogger(RobotScreenshotSource.class.getName()); + private Robot robot; public RobotScreenshotSource() throws AWTException, SecurityException { @@ -66,7 +70,7 @@ public void doStartupSanityChecks() { int bitDepth = bitAllocations[0] + bitAllocations[1] + bitAllocations[2]; if(bitDepth != 24) { - throw new IllegalStateException("Display colour depth incorrect (should be 8 bits of red, blue and green). Currently: " + log.warning("Display colour depth incorrect (should be 8 bits of red, blue and green). Currently: " + bitAllocations[0] + "-" + bitAllocations[1] + "-" + bitAllocations[2]); } }