From 759d72a46c5d487e6881426f90c54c6ae2da4847 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 13 Apr 2011 14:05:31 -0700 Subject: EXP-669 : Refactor code to use correct LLImageFormatted methods to load images of all formats, reviewed by richard --- .../llimage_libtest/llimage_libtest.cpp | 27 ++-------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'indra/integration_tests/llimage_libtest') diff --git a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp index 365f5f758c..03a79532c8 100644 --- a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp +++ b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp @@ -69,31 +69,8 @@ static bool sAllDone = false; // Create an empty formatted image instance of the correct type from the filename LLPointer create_image(const std::string &filename) { - std::string exten = gDirUtilp->getExtension(filename); - U32 codec = LLImageBase::getCodecFromExtension(exten); - - LLPointer image; - switch (codec) - { - case IMG_CODEC_BMP: - image = new LLImageBMP(); - break; - case IMG_CODEC_TGA: - image = new LLImageTGA(); - break; - case IMG_CODEC_JPEG: - image = new LLImageJPEG(); - break; - case IMG_CODEC_J2C: - image = new LLImageJ2C(); - break; - case IMG_CODEC_PNG: - image = new LLImagePNG(); - break; - default: - return NULL; - } - + std::string exten = gDirUtilp->getExtension(filename); + LLPointer image = LLImageFormatted::createFromExtension(exten); return image; } -- cgit v1.2.3