diff options
author | Mark Palange (Mani) <palange@lindenlab.com> | 2009-11-06 12:54:33 -0800 |
---|---|---|
committer | Mark Palange (Mani) <palange@lindenlab.com> | 2009-11-06 12:54:33 -0800 |
commit | 9317e46a878b36d8f44bbeb4a06ad22d66772e66 (patch) | |
tree | 71bdb2fbd3cc931c886c81b404aa02f80f14bea7 /indra/llimage | |
parent | 7caf37b9778d3f515a3a796547c09533bd4816b8 (diff) | |
parent | 05baf9940bd8e9491c4cc7fb426d8e56f50e4d22 (diff) |
Automated merge with ssh://hg.lindenlab.com/brad/brad-parabuild
Diffstat (limited to 'indra/llimage')
-rw-r--r-- | indra/llimage/llimage.cpp | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 9bbc55509d..73c23fa8d8 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -1223,25 +1223,28 @@ bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip ifs.read ((char*)buffer, length); ifs.close(); - image->updateData(); - - if (j2c_lowest_mip_only && codec == IMG_CODEC_J2C) + BOOL success; + + success = image->updateData(); + if (success) { - S32 width = image->getWidth(); - S32 height = image->getHeight(); - S32 discard_level = 0; - while (width > 1 && height > 1 && discard_level < MAX_DISCARD_LEVEL) + if (j2c_lowest_mip_only && codec == IMG_CODEC_J2C) { - width >>= 1; - height >>= 1; - discard_level++; + S32 width = image->getWidth(); + S32 height = image->getHeight(); + S32 discard_level = 0; + while (width > 1 && height > 1 && discard_level < MAX_DISCARD_LEVEL) + { + width >>= 1; + height >>= 1; + discard_level++; + } + ((LLImageJ2C *)((LLImageFormatted*)image))->setDiscardLevel(discard_level); } - ((LLImageJ2C *)((LLImageFormatted*)image))->setDiscardLevel(discard_level); + success = image->decode(this, 100000.0f); } - - BOOL success = image->decode(this, 100000.0f); - image = NULL; // deletes image + image = NULL; // deletes image if (!success) { deleteData(); |