diff --git a/doc/contributions.txt b/doc/contributions.txt --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -729,12 +729,13 @@ Thickbrick Sleaford SNOW-635 SNOW-743 VWR-7109 VWR-9287 VWR-13483 VWR-13947 + VWR-24420 Thraxis Epsilon SVC-371 VWR-383 tiamat bingyi CT-246 Tofu Buzzard diff --git a/indra/llimage/llpngwrapper.h b/indra/llimage/llpngwrapper.h --- a/indra/llimage/llpngwrapper.h +++ b/indra/llimage/llpngwrapper.h @@ -85,15 +85,12 @@ private: S32 mInterlaceType; S32 mCompressionType; S32 mFilterMethod; U32 mFinalSize; - bool mHasBKGD; - png_color_16p mBackgroundColor; - F64 mGamma; std::string mErrorMessage; }; #endif diff --git a/indra/llimage/llpngwrapper.cpp b/indra/llimage/llpngwrapper.cpp --- a/indra/llimage/llpngwrapper.cpp +++ b/indra/llimage/llpngwrapper.cpp @@ -47,14 +47,12 @@ LLPngWrapper::LLPngWrapper() mColorType( 0 ), mChannels( 0 ), mInterlaceType( 0 ), mCompressionType( 0 ), mFilterMethod( 0 ), mFinalSize( 0 ), - mHasBKGD(false), - mBackgroundColor(), mGamma(0.f) { } LLPngWrapper::~LLPngWrapper() { @@ -108,15 +106,15 @@ void LLPngWrapper::writeDataCallback(png void LLPngWrapper::writeFlush(png_structp png_ptr) { // no-op since we're just writing to memory } // Read the PNG file using the libpng. The low-level interface is used here -// because we want to do various transformations (including setting the -// matte background if any, and applying gama) which can't be done with -// the high-level interface. The scanline also begins at the bottom of +// because we want to do various transformations (including applying gama) +// which can't be done with the high-level interface. +// The scanline also begins at the bottom of // the image (per SecondLife conventions) instead of at the top, so we // must assign row-pointers in "reverse" order. BOOL LLPngWrapper::readPng(U8* src, LLImageRaw* rawImage, ImageInfo *infop) { try { @@ -198,14 +196,13 @@ BOOL LLPngWrapper::readPng(U8* src, LLIm void LLPngWrapper::normalizeImage() { // 1. Expand any palettes // 2. Convert grayscales to RGB // 3. Create alpha layer from transparency // 4. Ensure 8-bpp for all images - // 5. Apply background matte if any - // 6. Set (or guess) gamma + // 5. Set (or guess) gamma if (mColorType == PNG_COLOR_TYPE_PALETTE) { png_set_palette_to_rgb(mReadPngPtr); } if (mColorType == PNG_COLOR_TYPE_GRAY && mBitDepth < 8) @@ -226,18 +223,12 @@ void LLPngWrapper::normalizeImage() png_set_packing(mReadPngPtr); } else if (mBitDepth == 16) { png_set_strip_16(mReadPngPtr); } - mHasBKGD = png_get_bKGD(mReadPngPtr, mReadInfoPtr, &mBackgroundColor); - if (mHasBKGD) - { - png_set_background(mReadPngPtr, mBackgroundColor, - PNG_BACKGROUND_GAMMA_FILE, 1, 1.0); - } #if LL_DARWIN const F64 SCREEN_GAMMA = 1.8; #else const F64 SCREEN_GAMMA = 2.2; #endif @@ -258,13 +249,12 @@ void LLPngWrapper::updateMetaData() png_read_update_info(mReadPngPtr, mReadInfoPtr); mWidth = png_get_image_width(mReadPngPtr, mReadInfoPtr); mHeight = png_get_image_height(mReadPngPtr, mReadInfoPtr); mBitDepth = png_get_bit_depth(mReadPngPtr, mReadInfoPtr); mColorType = png_get_color_type(mReadPngPtr, mReadInfoPtr); mChannels = png_get_channels(mReadPngPtr, mReadInfoPtr); - mHasBKGD = png_get_bKGD(mReadPngPtr, mReadInfoPtr, &mBackgroundColor); } // Method to write raw image into PNG at dest. The raw scanline begins // at the bottom of the image per SecondLife conventions. BOOL LLPngWrapper::writePng(const LLImageRaw* rawImage, U8* dest) {