From 9ae5598ab8cdd27b30d726bfbf58fcab41bcc416 Mon Sep 17 00:00:00 2001 From: Robin Krom Date: Tue, 29 Mar 2022 09:05:25 +0200 Subject: [PATCH] Solved the clipboard loading for the DIB file format too, this is related to #396 --- .../FileFormatHandlers/DibFileFormatHandler.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Greenshot.Editor/FileFormatHandlers/DibFileFormatHandler.cs b/src/Greenshot.Editor/FileFormatHandlers/DibFileFormatHandler.cs index 1e7515e8d..cf18cddb7 100644 --- a/src/Greenshot.Editor/FileFormatHandlers/DibFileFormatHandler.cs +++ b/src/Greenshot.Editor/FileFormatHandlers/DibFileFormatHandler.cs @@ -87,8 +87,9 @@ namespace Greenshot.Editor.FileFormatHandlers bitmapStream.Write(dibBuffer, 0, dibBuffer.Length); bitmapStream.Seek(0, SeekOrigin.Begin); // TODO: Replace with a FileFormatHandler - bitmap = ImageIO.FromStream(bitmapStream) as Bitmap; - return true; + using var beforeCloneImage = Image.FromStream(bitmapStream); + bitmap = ImageHelper.Clone(beforeCloneImage) as Bitmap; + return bitmap != null; } Log.Info("Using special DIBV5 / Format17 format reader"); // CF_DIBV5