diff options
Diffstat (limited to 'indra/newview/llfloaterimagepreview.cpp')
-rw-r--r-- | indra/newview/llfloaterimagepreview.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index 4f7ef34fe1..457a87adb2 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -13,6 +13,7 @@ #include "llimagebmp.h" #include "llimagetga.h" #include "llimagejpeg.h" +#include "llimagepng.h" #include "llagent.h" #include "llbutton.h" @@ -305,6 +306,10 @@ bool LLFloaterImagePreview::loadImage(const char *src_filename) { codec = IMG_CODEC_JPEG; } + else if( 0 == strnicmp(ext, ".png", 4) ) + { + codec = IMG_CODEC_PNG; + } LLPointer<LLImageRaw> raw_image = new LLImageRaw; @@ -362,6 +367,21 @@ bool LLFloaterImagePreview::loadImage(const char *src_filename) } } break; + case IMG_CODEC_PNG: + { + LLPointer<LLImagePNG> png_image = new LLImagePNG; + + if (!png_image->load(src_filename)) + { + return false; + } + + if (!png_image->decode(raw_image)) + { + return false; + } + } + break; default: return false; } |