Release v0.6.20: edit history images and share smooth wheel handling

This commit is contained in:
2026-10-31 09:12:59 +02:00
parent 6603d28f68
commit 70ea9b10bc
22 changed files with 334 additions and 33 deletions
+13
View File
@@ -112,6 +112,19 @@ std::wstring escapeXml(const std::wstring &s)
return result;
}
}
std::wstring cacheScreenshotForEditor(const Clip &clip)
{
// Normalize PNG/DIBV5 and other supported clipboard images at full resolution.
auto pixels=decodeImage(clip);
if(pixels.bgra.empty() || pixels.bgra.size()>128*1024*1024-sizeof(BITMAPINFOHEADER))
throw std::runtime_error("Image is too large for the screenshot editor");
auto dib=imageDib(pixels);
auto directory=cacheDirectory(); cleanCache(directory);
GUID guid{}; check(CoCreateGuid(&guid)); wchar_t value[40]{}; StringFromGUID2(guid,value,40);
std::wstring id(value+1,36);
atomicWrite(directory/(id+L".capture"),protect(dib.data));
return id;
}
Clip loadNotifiedScreenshot(const std::wstring &id)
{
if(!validScreenshotToken(id)) throw std::runtime_error("Invalid screenshot notification");