mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-04 14:47:37 +03:00
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
This commit is contained in:
parent
72c2cea089
commit
12e9c3e29a
@ -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<std::string> ImageDecoderFactory::getSupportedFormats() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user