- controlapi: fix filename in GlcdScreenshotCGI()

This commit is contained in:
vanhofen
2023-02-09 21:23:34 +01:00
committed by Thilo Graf
parent d009521754
commit 4cb74815f8

View File

@@ -2200,14 +2200,17 @@ void CControlAPI::ScreenshotCGI(CyhookHandler *hh)
} }
} }
#endif #endif
#ifdef ENABLE_GRAPHLCD #ifdef ENABLE_GRAPHLCD
void CControlAPI::GlcdScreenshotCGI(CyhookHandler *hh) void CControlAPI::GlcdScreenshotCGI(CyhookHandler *hh)
{ {
std::string filename = "/tmp/glcdscreenshot.png"; std::string filename = "screenshot-glcd";
if(!hh->ParamList["name"].empty()) if(!hh->ParamList["name"].empty())
filename = hh->ParamList["name"]; filename = hh->ParamList["name"];
filename = "/tmp/" + filename + ".png";
cGLCD *cglcd = cGLCD::getInstance(); cGLCD *cglcd = cGLCD::getInstance();
if (cglcd) { if (cglcd) {
if (cglcd->dumpBuffer((uint32_t*)cglcd->bitmap->Data(), cGLCD::PNG, filename.c_str())) if (cglcd->dumpBuffer((uint32_t*)cglcd->bitmap->Data(), cGLCD::PNG, filename.c_str()))