Alien-FreeImage
view release on metacpan or search on metacpan
src/Source/LibJXR/image/encode/strenc.c view on Meta::CPAN
if(pSC->ppTempFile[i] == NULL) return ICERR_ERROR;
pFilename = (char *)pSC->ppTempFile[i];
cSize = GetTempPath(MAX_PATH, szPath);
if(cSize == 0 || cSize >= MAX_PATH)
return ICERR_ERROR;
if(!GetTempFileName(szPath, TEXT("wdp"), 0, pSC->ppTempFile[i]))
return ICERR_ERROR;
if(bUnicode){ // unicode file name
for(k = j = cSize = 0; cSize < MAX_PATH; cSize ++, j += 2){
if(pSC->ppTempFile[i][cSize] == '\0')
break;
if(pFilename[j] != '\0')
pFilename[k ++] = pFilename[j];
if(pFilename[j + 1] != '\0')
pFilename[k ++] = pFilename[j + 1];
}
pFilename[cSize] = '\0';
}
src/Source/LibJXR/jxrgluelib/JXRMeta.c view on Meta::CPAN
ERR ReadBinaryData(__in_ecount(1) struct WMPStream* pWS,
const __in_win U32 uCount,
const __in_win U32 uValue,
U8 **ppbData)
{
ERR err = WMP_errSuccess;
U8 *pbData = NULL;
Call(PKAlloc((void **) &pbData, uCount + 2)); // Allocate buffer to store data with space for an added ascii or unicode null
if (uCount <= 4)
{
unsigned int i;
for (i = 0; i < uCount; i++)
pbData[i] = ((U8*)&uValue)[i]; // Copy least sig bytes - we assume 'II' type TIFF files
}
else
{
size_t offPosPrev;
src/Source/LibJXR/jxrgluelib/JXRMeta.c view on Meta::CPAN
memset(pvar, 0, sizeof(*pvar));
if (uCount == 0)
goto Cleanup; // Nothing to read in here
switch (uType)
{
case WMP_typASCII:
pvar->vt = DPKVT_LPSTR;
Call(ReadBinaryData(pWS, uCount, uValue, (U8 **) &pvar->VT.pszVal));
assert(0 == pvar->VT.pszVal[uCount - 1]); // Check that it's null-terminated
// make sure (ReadBinaryData allocated uCount + 2 so this and unicode can have forced nulls)
pvar->VT.pszVal[uCount] = 0;
break;
case WMP_typBYTE:
case WMP_typUNDEFINED:
// Return as regular C array rather than safearray, as this type is sometimes
// used to convey unicode (which does not require a count field). Caller knows
// uCount and can convert to safearray if necessary.
pvar->vt = (DPKVT_BYREF | DPKVT_UI1);
Call(ReadBinaryData(pWS, uCount, uValue, &pvar->VT.pbVal));
break;
case WMP_typSHORT:
if (1 == uCount)
{
pvar->vt = DPKVT_UI2;
pvar->VT.uiVal = (U16)(uValue & 0x0000FFFF);
( run in 1.418 second using v1.01-cache-2.11-cpan-88abd93f124 )