Problems reading animated gif

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

Moderators: XnTriq, helmut, xnview

Post Reply
Alessandro

Problems reading animated gif

Post by Alessandro »

Hi

I tryed to open an animated gif but info.NumberOfImages returns always 1 so I dunno how many frames are stored into it and about the framerate... how do I know the speed of the animation? maybe for animated gif is there a standard I don't know of?

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

Re: Problems reading animated gif

Post by xnview »

Alessandro wrote:I tryed to open an animated gif but info.NumberOfImages returns always 1 so I dunno how many frames are stored into it and about the framerate... how do I know the speed of the animation? maybe for animated gif is there a standard I don't know of?
Currrently not possible to know the frame rate. And for gif animated, there is a little problem, try gflLoadBitmap and you'll have a NumberOfImages not 1
Pierre.
voja21
Posts: 2
Joined: Thu Nov 30, 2006 10:37 am
Location: Belgrade

How to extract other frames?

Post by voja21 »

When I convert gif to some other format, I got only first frame. How to access (and save) other?
User avatar
xnview
Author of XnView
Posts: 43357
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: How to extract other frames?

Post by xnview »

voja21 wrote:When I convert gif to some other format, I got only first frame. How to access (and save) other?
You have GFL_LOAD_PARAMS::ImageWanted
Pierre.
lazyeugene
Posts: 16
Joined: Sat Oct 03, 2009 10:17 am
Location: Ukraine

Re: Problems reading animated gif

Post by lazyeugene »

Is there any method to determine value of "Background Color Index" for whole gif and "Disposal Method" and "Delay" fields for pictures in animated gif? Pictures itself reads correctly, but I can't find out how to get this fields :(
lazyeugene
Posts: 16
Joined: Sat Oct 03, 2009 10:17 am
Location: Ukraine

Re: Problems reading animated gif

Post by lazyeugene »

And there is another problem. I'm trying to load animated gif with about a three hundreds of frames. It is not quite big - about 60k, but it loads several seconds. As i call to load evety frame individually, the library, as I suppose, must again and again load and decode file from the beginning. Maybe there is wokaround?
User avatar
xnview
Author of XnView
Posts: 43357
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Problems reading animated gif

Post by xnview »

lazyeugene wrote:Is there any method to determine value of "Background Color Index" for whole gif and "Disposal Method" and "Delay" fields for pictures in animated gif? Pictures itself reads correctly, but I can't find out how to get this fields :(
No sorry
lazyeugene wrote:And there is another problem. I'm trying to load animated gif with about a three hundreds of frames. It is not quite big - about 60k, but it loads several seconds. As i call to load evety frame individually, the library, as I suppose, must again and again load and decode file from the beginning. Maybe there is wokaround?
The problem is that GFL need to decompress all previous frames...
Pierre.
lazyeugene
Posts: 16
Joined: Sat Oct 03, 2009 10:17 am
Location: Ukraine

Re: Problems reading animated gif

Post by lazyeugene »

xnview wrote:
lazyeugene wrote:Is there any method to determine value of "Background Color Index" for whole gif and "Disposal Method" and "Delay" fields for pictures in animated gif? Pictures itself reads correctly, but I can't find out how to get this fields :(
No sorry
But adding this fields to GFL_BITMAP structure should not be a problem, isn't it?
xnview wrote:
lazyeugene wrote:And there is another problem. I'm trying to load animated gif with about a three hundreds of frames. It is not quite big - about 60k, but it loads several seconds. As i call to load evety frame individually, the library, as I suppose, must again and again load and decode file from the beginning. Maybe there is wokaround?
The problem is that GFL need to decompress all previous frames...
Maybe you can register some kind of GFL_BITMAP array[]? Or save a pointer to next picture (offset from the begining of file) in GFL_BITMAP structure and accept it in load bitmap requests?

This is just a few fields, but without them it is almost unreal to load animated gif's. Please...
User avatar
xnview
Author of XnView
Posts: 43357
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Problems reading animated gif

Post by xnview »

No, the better way is to add a function to load all bitmap from animated file
Pierre.
lazyeugene
Posts: 16
Joined: Sat Oct 03, 2009 10:17 am
Location: Ukraine

Re: Problems reading animated gif

Post by lazyeugene »

I'll be waiting for a new version, thank you.
Post Reply