diff options
Diffstat (limited to 'linden/indra/newview/llfloaterimagepreview.cpp')
-rw-r--r-- | linden/indra/newview/llfloaterimagepreview.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/linden/indra/newview/llfloaterimagepreview.cpp b/linden/indra/newview/llfloaterimagepreview.cpp index 9dfaa49..0a91563 100644 --- a/linden/indra/newview/llfloaterimagepreview.cpp +++ b/linden/indra/newview/llfloaterimagepreview.cpp | |||
@@ -33,6 +33,7 @@ | |||
33 | #include "llimagebmp.h" | 33 | #include "llimagebmp.h" |
34 | #include "llimagetga.h" | 34 | #include "llimagetga.h" |
35 | #include "llimagejpeg.h" | 35 | #include "llimagejpeg.h" |
36 | #include "llimagepng.h" | ||
36 | 37 | ||
37 | #include "llagent.h" | 38 | #include "llagent.h" |
38 | #include "llbutton.h" | 39 | #include "llbutton.h" |
@@ -325,6 +326,10 @@ bool LLFloaterImagePreview::loadImage(const char *src_filename) | |||
325 | { | 326 | { |
326 | codec = IMG_CODEC_JPEG; | 327 | codec = IMG_CODEC_JPEG; |
327 | } | 328 | } |
329 | else if( 0 == strnicmp(ext, ".png", 4) ) | ||
330 | { | ||
331 | codec = IMG_CODEC_PNG; | ||
332 | } | ||
328 | 333 | ||
329 | LLPointer<LLImageRaw> raw_image = new LLImageRaw; | 334 | LLPointer<LLImageRaw> raw_image = new LLImageRaw; |
330 | 335 | ||
@@ -382,6 +387,21 @@ bool LLFloaterImagePreview::loadImage(const char *src_filename) | |||
382 | } | 387 | } |
383 | } | 388 | } |
384 | break; | 389 | break; |
390 | case IMG_CODEC_PNG: | ||
391 | { | ||
392 | LLPointer<LLImagePNG> png_image = new LLImagePNG; | ||
393 | |||
394 | if (!png_image->load(src_filename)) | ||
395 | { | ||
396 | return false; | ||
397 | } | ||
398 | |||
399 | if (!png_image->decode(raw_image)) | ||
400 | { | ||
401 | return false; | ||
402 | } | ||
403 | } | ||
404 | break; | ||
385 | default: | 405 | default: |
386 | return false; | 406 | return false; |
387 | } | 407 | } |