Merge branch 'master' of https://github.com/siana/SingularityViewer
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include "apr_dso.h"
|
||||
|
||||
#include "lldir.h"
|
||||
#include "../llxml/llcontrol.h"
|
||||
#include "llimagej2c.h"
|
||||
#include "llmemtype.h"
|
||||
|
||||
@@ -377,6 +378,12 @@ S32 LLImageJ2C::calcHeaderSize()
|
||||
// to load discard_level (including header and higher discard levels)
|
||||
S32 LLImageJ2C::calcDataSize(S32 discard_level)
|
||||
{
|
||||
static const LLCachedControl<bool> legacy_size("SianaLegacyJ2CSize", false);
|
||||
|
||||
if (legacy_size) {
|
||||
return calcDataSizeJ2C(getWidth(), getHeight(), getComponents(), discard_level, mRate);
|
||||
}
|
||||
|
||||
discard_level = llclamp(discard_level, 0, MAX_DISCARD_LEVEL);
|
||||
|
||||
if ( mAreaUsedForDataSizeCalcs != (getHeight() * getWidth())
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
|
||||
#include <csetjmp>
|
||||
|
||||
#include "llimage.h"
|
||||
|
||||
extern "C" {
|
||||
#ifdef LL_STANDALONE
|
||||
# include <jpeglib.h>
|
||||
@@ -45,8 +47,6 @@ extern "C" {
|
||||
#endif
|
||||
}
|
||||
|
||||
#include "llimage.h"
|
||||
|
||||
class LLImageJPEG : public LLImageFormatted
|
||||
{
|
||||
protected:
|
||||
|
||||
@@ -213,7 +213,7 @@ void LLPngWrapper::normalizeImage()
|
||||
}
|
||||
if (mColorType == PNG_COLOR_TYPE_GRAY && mBitDepth < 8)
|
||||
{
|
||||
png_set_gray_1_2_4_to_8(mReadPngPtr);
|
||||
png_set_expand_gray_1_2_4_to_8(mReadPngPtr);
|
||||
}
|
||||
if (mColorType == PNG_COLOR_TYPE_GRAY
|
||||
|| mColorType == PNG_COLOR_TYPE_GRAY_ALPHA)
|
||||
@@ -354,7 +354,7 @@ void LLPngWrapper::releaseResources()
|
||||
{
|
||||
if (mReadPngPtr || mReadInfoPtr)
|
||||
{
|
||||
png_destroy_read_struct(&mReadPngPtr, &mReadInfoPtr, png_infopp_NULL);
|
||||
png_destroy_read_struct(&mReadPngPtr, &mReadInfoPtr, NULL);
|
||||
mReadPngPtr = NULL;
|
||||
mReadInfoPtr = NULL;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,11 @@
|
||||
#ifndef LL_LLPNGWRAPPER_H
|
||||
#define LL_LLPNGWRAPPER_H
|
||||
|
||||
#if LL_WINDOWS
|
||||
#include "libpng15/png.h"
|
||||
#else
|
||||
#include "libpng12/png.h"
|
||||
#endif
|
||||
#include "llimage.h"
|
||||
|
||||
class LLPngWrapper
|
||||
|
||||
Reference in New Issue
Block a user