diff options
author | Jacek Antonelli | 2008-08-15 23:44:59 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:59 -0500 |
commit | a408bac29378072fbf36864164149458c978cfcc (patch) | |
tree | 67feccf1a5d3816611ba48d6762f86f0f7f4b1f6 /linden/indra/newview/llfloaterimagepreview.cpp | |
parent | Second Life viewer sources 1.17.0.12 (diff) | |
download | meta-impy-a408bac29378072fbf36864164149458c978cfcc.zip meta-impy-a408bac29378072fbf36864164149458c978cfcc.tar.gz meta-impy-a408bac29378072fbf36864164149458c978cfcc.tar.bz2 meta-impy-a408bac29378072fbf36864164149458c978cfcc.tar.xz |
Second Life viewer sources 1.17.1.0
Diffstat (limited to '')
-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 | } |