feat: Add PNG cover image support for EPUB books (#827)
Cherry-pick upstream PR #827 with conflict resolution for mod/master: - Add PngToBmpConverter library for PNG cover → BMP conversion - Add PNG thumbnail generation in generateThumbBmp() - Fix generateCoverBmp() PNG block to use effectiveCoverImageHref (consistent with mod's fallback cover candidate probing) - Add .png to getCoverCandidates() extensions - Use LOG_ERR macro in ImageToFramebufferDecoder (mod standard) - Upstream image converter refinements (ImageBlock, PixelCache, JpegToFramebufferConverter, PngToFramebufferConverter) Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
14
lib/PngToBmpConverter/PngToBmpConverter.h
Normal file
14
lib/PngToBmpConverter/PngToBmpConverter.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
class FsFile;
|
||||
class Print;
|
||||
|
||||
class PngToBmpConverter {
|
||||
static bool pngFileToBmpStreamInternal(FsFile& pngFile, Print& bmpOut, int targetWidth, int targetHeight, bool oneBit,
|
||||
bool crop = true);
|
||||
|
||||
public:
|
||||
static bool pngFileToBmpStream(FsFile& pngFile, Print& bmpOut, bool crop = true);
|
||||
static bool pngFileToBmpStreamWithSize(FsFile& pngFile, Print& bmpOut, int targetMaxWidth, int targetMaxHeight);
|
||||
static bool pngFileTo1BitBmpStreamWithSize(FsFile& pngFile, Print& bmpOut, int targetMaxWidth, int targetMaxHeight);
|
||||
};
|
||||
Reference in New Issue
Block a user