Fix the label corruption issue
All checks were successful
Build ptprnt / build (push) Successful in 4m43s

This commit is contained in:
2025-10-11 17:04:55 +02:00
parent 6e3a5bd12f
commit 59b3b34edc
6 changed files with 149 additions and 27 deletions

View File

@@ -86,6 +86,20 @@ class FakePrinter : public ::ptprnt::IPrinterDriver {
*/
graphics::Bitmap<graphics::ALPHA8> simulatePrinting(const graphics::MonochromeData& data);
/**
* @brief Save bitmap to PNG file using Cairo
* @param bitmap The bitmap to save
* @param filename Output filename
* @return true if successful
*/
bool saveBitmapToPng(const graphics::Bitmap<graphics::ALPHA8>& bitmap, const std::string& filename) const;
/**
* @brief Generate timestamped filename for fake label output
* @return Filename like "fakelabel_20231011_123456.png"
*/
std::string generateTimestampedFilename() const;
std::unique_ptr<graphics::Bitmap<graphics::ALPHA8>> mLastPrint;
bool mHasAttachedDevice = false;
PrinterStatus mStatus{.tapeWidthMm = 12}; // Default to 12mm tape