diff --git a/imagepaste/clipboard/windows/windows.py b/imagepaste/clipboard/windows/windows.py index 11736ae..9995d09 100644 --- a/imagepaste/clipboard/windows/windows.py +++ b/imagepaste/clipboard/windows/windows.py @@ -40,6 +40,8 @@ def push(cls, save_directory: str) -> WindowsClipboard: "Add-Type -AssemblyName System.Drawing; " "$clipboard = [System.Windows.Forms.Clipboard]::GetDataObject(); " "$imageStream = $clipboard.GetData('PNG'); " + "if ($null -eq $imageStream) { $imageStream = $clipboard.GetData('image/png') }; " + "if ($null -eq $imageStream) { $imageStream = $clipboard.GetData('System.Drawing.Bitmap') }; " "if ($imageStream) {" "$bitmap = New-Object System.Drawing.Bitmap($imageStream); " f"$bitmap.Save('{filepath}', [System.Drawing.Imaging.ImageFormat]::Png); "