To retrieve "compression" field like Windows Explorer->Right button click->Properties->Details
You have to use GdiPlus library:
1. Create Image class object (
http://msdn.microsoft.com/en-us/library/windows/desktop/ms534462(v=vs.85).aspx[
^])
2. Get compression method (PropertyTagCompression) from image metadata calling Image.GetPropertyItem method (
http://msdn.microsoft.com/en-us/library/windows/desktop/ms535390(v=vs.85).aspx[
^])
3. Compare returned value with possible discrete values for PKEY_Image_Compression (IMAGE_COMPRESSION_*) declared in propkey.h
Code example:
#include <windows.h>
#include <gdiplus.h>
#include <propkey.h>
using namespace Gdiplus;
BOOL GetCompressionMethod(
PWSTR pwszImage,
PUSHORT pusCompresssionMethod)
{
GdiplusStartupInput StartupInput;
ULONG_PTR Token;
Image *pImage;
UINT uiSize;
PropertyItem *pItem;
Status Result;
GdiplusStartup(&Token, &StartupInput, NULL);
pImage = new Image(pwszImage);
if (pImage == NULL)
{
GdiplusShutdown(Token);
return FALSE;
}
uiSize = pImage->GetPropertyItemSize(
PropertyTagCompression);
if (uiSize == 0)
{
delete pImage;
GdiplusShutdown(Token);
return FALSE;
}
pItem = (PropertyItem *) new BYTE [uiSize];
if (pItem == NULL)
{
delete pImage;
GdiplusShutdown(Token);
return FALSE;
}
Result = pImage->GetPropertyItem(
PropertyTagCompression, uiSize, pItem);
if (Result != Ok)
{
delete [] ((PBYTE) pItem);
delete pImage;
GdiplusShutdown(Token);
return FALSE;
}
*pusCompresssionMethod = *(PUSHORT) pItem->value;
switch (*(PUSHORT) pItem->value)
{
case IMAGE_COMPRESSION_UNCOMPRESSED:
break;
case IMAGE_COMPRESSION_CCITT_T3:
break;
case IMAGE_COMPRESSION_CCITT_T4:
break;
case IMAGE_COMPRESSION_CCITT_T6:
break;
case IMAGE_COMPRESSION_LZW:
break;
case IMAGE_COMPRESSION_JPEG:
break;
case IMAGE_COMPRESSION_PACKBITS:
break;
}
delete [] ((PBYTE) pItem);
delete pImage;
GdiplusShutdown(Token);
return TRUE;
}