#include "FMedia_ColorConverter.h"
#include "FMedia_ImageDecoder.h"
#include "FMedia_PngDecoder.h"
+#include "FMedia_JpegDecoder.h"
#include "FMedia_JpegTurboDecoder.h"
#include "FMedia_GifDecoder.h"
#include "FMedia_BmpDecoder.h"
// Decoder construction
r = __pDec->Construct((byte*) __pSrcBuf->GetPointer(), __pSrcBuf->GetCapacity(), pixelFormat);
+ // TODO: enhance me. turbo jpeg construction failed.
+ if (IsFailed(r) && __imgFormat == IMG_FORMAT_JPG)
+ {
+ __pDec.reset(new (std::nothrow) _JpegDecoder());
+ SysTryCatch(NID_MEDIA, __pDec.get() != null, r = GetLastResult(), r,
+ "[%s] Could not create decoder for image format %d.",
+ GetErrorMessage(r), __imgFormat);
+
+ // Decoder construction
+ r = __pDec->Construct((byte*) __pSrcBuf->GetPointer(), __pSrcBuf->GetCapacity(), pixelFormat);
+ }
SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagated.", GetErrorMessage(r));
// Get original dimension