From ff28388b041d632f999d394cdaf5ac4572dcc5fd Mon Sep 17 00:00:00 2001 From: Martin Brook Date: Fri, 30 Jan 2026 17:48:40 +0000 Subject: [PATCH] fix: isFormatSupported now correctly extracts extension Address review comment #6: - isFormatSupported() was passing the full path to supportsFormat() which only matches extensions like ".jpg", so it always returned false - Delegate to getDecoder() which correctly extracts the extension first --- lib/Epub/Epub/converters/ImageDecoderFactory.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/Epub/Epub/converters/ImageDecoderFactory.cpp b/lib/Epub/Epub/converters/ImageDecoderFactory.cpp index 8b26b6e6..8c85e49b 100644 --- a/lib/Epub/Epub/converters/ImageDecoderFactory.cpp +++ b/lib/Epub/Epub/converters/ImageDecoderFactory.cpp @@ -50,13 +50,7 @@ ImageToFramebufferDecoder* ImageDecoderFactory::getDecoder(const std::string& im } bool ImageDecoderFactory::isFormatSupported(const std::string& imagePath) { - if (jpegDecoder && jpegDecoder->supportsFormat(imagePath)) { - return true; - } - if (pngDecoder && pngDecoder->supportsFormat(imagePath)) { - return true; - } - return false; + return getDecoder(imagePath) != nullptr; } std::vector ImageDecoderFactory::getSupportedFormats() {