diff --git a/components/rtgui/common/image_jpg.c b/components/rtgui/common/image_jpg.c index c445c6a14f..decf6de8c7 100644 --- a/components/rtgui/common/image_jpg.c +++ b/components/rtgui/common/image_jpg.c @@ -4,12 +4,16 @@ #ifdef RTGUI_IMAGE_JPEG #include #include -#include "jpeg/jpeglib.h" +#include "jpeglib.h" #include #include #include +#ifdef RTGUI_USING_DFS_FILERW +#include +#endif + static rt_bool_t rtgui_image_jpeg_check(struct rtgui_filerw* file); static rt_bool_t rtgui_image_jpeg_load(struct rtgui_image* image, struct rtgui_filerw* file, rt_bool_t load); static void rtgui_image_jpeg_unload(struct rtgui_image* image); @@ -44,6 +48,16 @@ struct rtgui_image_engine rtgui_image_jpeg_engine = rtgui_image_jpeg_blit }; +struct rtgui_image_engine rtgui_image_jpg_engine = +{ + "jpg", + {RT_NULL}, + rtgui_image_jpeg_check, + rtgui_image_jpeg_load, + rtgui_image_jpeg_unload, + rtgui_image_jpeg_blit +}; + #define INPUT_BUFFER_SIZE 4096 typedef struct { struct jpeg_source_mgr pub; @@ -271,6 +285,8 @@ void rtgui_image_jpeg_init() { /* register jpeg on image system */ rtgui_image_register_engine(&rtgui_image_jpeg_engine); + /* register jpg on image system */ + rtgui_image_register_engine(&rtgui_image_jpg_engine); } static void my_error_exit(j_common_ptr cinfo) diff --git a/components/rtgui/common/image_png.c b/components/rtgui/common/image_png.c index 0c63e80cf8..9c72ef02f4 100644 --- a/components/rtgui/common/image_png.c +++ b/components/rtgui/common/image_png.c @@ -2,7 +2,7 @@ #include #ifdef RTGUI_IMAGE_PNG -#include "libpng/png.h" +#include "png.h" #include #define PNG_MAGIC_LEN 8