diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index aa82ca729..83e678220 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -52,6 +52,26 @@ void CPictureViewer::add_format (int (*picsize) (const char *, int *, int *, int fh_root = fhn; } +void CPictureViewer::getSupportedImageFormats(std::vector& exts) +{ +#ifdef FBV_SUPPORT_PNG + exts.push_back(".png"); +#endif +#ifdef FBV_SUPPORT_GIF + exts.push_back(".gif"); +#endif +#ifdef FBV_SUPPORT_JPEG + exts.push_back(".jpg"); + exts.push_back(".jpeg"); +#endif +#ifdef FBV_SUPPORT_BMP + exts.push_back(".bmp"); +#endif +#ifdef FBV_SUPPORT_CRW + exts.push_back(".crw"); +#endif +} + void CPictureViewer::init_handlers (void) { #ifdef FBV_SUPPORT_PNG diff --git a/src/driver/pictureviewer/pictureviewer.h b/src/driver/pictureviewer/pictureviewer.h index d6f3e9aee..bd7c8f295 100644 --- a/src/driver/pictureviewer/pictureviewer.h +++ b/src/driver/pictureviewer/pictureviewer.h @@ -27,6 +27,7 @@ */ #include +#include #include /* printf */ #include /* gettimeofday */ #include "driver/framebuffer.h" @@ -71,6 +72,7 @@ class CPictureViewer unsigned char * Resize(unsigned char *orgin, int ox, int oy, int dx, int dy, ScalingMode type, unsigned char * dst = NULL); unsigned char * ResizeA(unsigned char *orgin, int ox, int oy, int dx, int dy); void rescaleImageDimensions(int *width, int *height, const int max_width, const int max_height, bool upscale=false); + void getSupportedImageFormats(std::vector& erw); private: CFormathandler *fh_root;