Problem loading animated GIF (ImageWanted>0)

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: XnTriq, xnview

Post Reply
Mex7
Posts: 1
Joined: Tue Aug 25, 2009 6:07 pm

Problem loading animated GIF (ImageWanted>0)

Post by Mex7 » Tue Aug 25, 2009 8:21 pm

GFL version 3.11
I'm trying to work with animated gif (attached).
Problem is: loading frame > 0. GFL decodes only changes (?) of frame 0. Is it true?

Part of code:

Code: Select all

	GFLBitmap = NULL;
	GFL_LOAD_PARAMS LoadParams = {0};
	gflGetDefaultLoadParams(&LoadParams);
	LoadParams.Flags = GFL_LOAD_COMMENT;
	LoadParams.ColorModel = GFL_BGRA;
	LoadParams.LinePadding = 1;
	LoadParams.ImageWanted = Image->iPage;
	GFL_FILE_INFORMATION FileInformation = {0};
	if (!gflLoadBitmapW(Image->FileName, &GFLBitmap, &LoadParams, &FileInformation))
	{
		#ifdef _DEBUG
		wchar_t szDbg[MAX_PATH*2];
		wsprintf(szDbg, L"Decoding (%s), frame %i of %i\n", Image->FileName, Image->iPage, FileInformation.NumberOfImages);
		OutputDebugString(szDbg);
		wsprintf(szDbg, L"  GFLBitmap:  W=%i, H=%i, XO=%i, YO=%i\n", GFLBitmap->Width, GFLBitmap->Height, GFLBitmap->XOffset, GFLBitmap->YOffset);
		OutputDebugString(szDbg);
		wsprintf(szDbg, L"  LoadParams: W=%i, H=%i\n", LoadParams.Width, LoadParams.Height);
		OutputDebugString(szDbg);
		wsprintf(szDbg, L"  FileInfo:   W=%i, H=%i, XO=%i, YO=%i\n", FileInformation.Width, FileInformation.Height, FileInformation.XOffset, FileInformation.YOffset);
		OutputDebugString(szDbg);
		OutputDebugString(L"\n");
		#endif
produces debug output:

Code: Select all

Decoding (F:\VCProject\FarPlugin\ConEmu\Bugs\Birthday_gift.gif), frame 0 of 19
  GFLBitmap:  W=240, H=200, XO=0, YO=0
  LoadParams: W=256, H=256
  FileInfo:   W=240, H=200, XO=0, YO=0

Decoding (F:\VCProject\FarPlugin\ConEmu\Bugs\Birthday_gift.gif), frame 1 of 19
  GFLBitmap:  W=80, H=115, XO=0, YO=0
  LoadParams: W=256, H=256
  FileInfo:   W=80, H=115, XO=0, YO=0

Decoding (F:\VCProject\FarPlugin\ConEmu\Bugs\Birthday_gift.gif), frame 2 of 19
  GFLBitmap:  W=121, H=176, XO=0, YO=0
  LoadParams: W=256, H=256
  FileInfo:   W=121, H=176, XO=0, YO=0

Decoding (F:\VCProject\FarPlugin\ConEmu\Bugs\Birthday_gift.gif), frame 3 of 19
  GFLBitmap:  W=124, H=112, XO=0, YO=0
  LoadParams: W=256, H=256
  FileInfo:   W=124, H=112, XO=0, YO=0

Decoding (F:\VCProject\FarPlugin\ConEmu\Bugs\Birthday_gift.gif), frame 4 of 19
  GFLBitmap:  W=168, H=86, XO=0, YO=0
  LoadParams: W=256, H=256
  FileInfo:   W=168, H=86, XO=0, YO=0

Decoding (F:\VCProject\FarPlugin\ConEmu\Bugs\Birthday_gift.gif), frame 5 of 19
  GFLBitmap:  W=193, H=149, XO=0, YO=0
  LoadParams: W=256, H=256
  FileInfo:   W=193, H=149, XO=0, YO=0
Looks like GFL decodes only changes of frame 0, but does not returns offset of this frame... So I can't draw frames (>0) over frame 0 by myself.

Can You help me? What's wrong, arguments? Or a bug in SDK?
Attachments
Birthday_gift.gif
Birthday_gift.gif (39 KiB) Viewed 1556 times

User avatar
xnview
Author of XnView
Posts: 31491
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Problem loading animated GIF (ImageWanted>0)

Post by xnview » Wed Aug 26, 2009 1:15 pm

Mex7 wrote: Looks like GFL decodes only changes of frame 0, but does not returns offset of this frame... So I can't draw frames (>0) over frame 0 by myself.
Yes, only changes. It's a problem...
Pierre.

Post Reply