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() {