Re: Number of frames in animated GIF

From: Vassili Maroussov <Vassili.Maroussov_at_cern.ch>
Date: Mon, 3 Mar 2008 15:49:11 +0100


Dear Olivier,

for simplicity try in ROOT: TImage *img = TImage::Open("some.gif.N") on some gif, that contain only one frame. With N=0 it just read the "some.gif", with N=1 you get the error message "Image file \"some.gif\" does not have subimage 1". The message is generated in the gif2ASImage(..) function in root/asimage/src/libAfterImage/import.c, line 1743, the show_error(...) function call. All I wanted to suppress the error message (just having an information whether the operation was successful) in ROOT like I can do it for most of native ROOT functions by setting gErrorIgnoreLevel to a value I need. Actually for me it looks rather logical just have returned NULL by TImage::Open(...) in a case if operation wasn't successful. As for the initial question how to count frames in a GIF file, I have found an answer in http://www.let.rug.nl/~kleiweg/gif/gif.html

Regards,

Vassili

Olivier Couet wrote:
>
> Hi Vassili,
>
>
>
> Can you send me a small example reproducing your problem ?
>
>
>
> Cheers, O.Couet
>
>
>
> *From:* Vassili Maroussov
> *Sent:* Friday, February 29, 2008 6:44 PM
> *To:* Olivier Couet
> *Cc:* roottalk
> *Subject:* Re: [ROOT] Number of frames in animated GIF
>
>
>
> Dear Olivier,
>
> Actually if I do TImage *img = TImage::Open("anim.gif.N") with not
> existing frame N, them img->IsValid() return false (I'm wondering why
> "img" is not 0 after an unsuccessful "TImage::Open" :)). How to
> suppress the error report by the "TImage::Open"?
>
> Regards,
>
> Vassili
>
> Olivier Couet wrote:
>
> With root you can write animated gi but you can read them.
> There is no way to retrieve the number of frames in a animated gif with
> a ROOT command.
>
>
> -----Original Message-----
> From: Vassili Maroussov
> Sent: Friday, February 29, 2008 5:41 PM
> To: Olivier Couet
> Cc: roottalk
> Subject: Re: [ROOT] Number of frames in animated GIF
>
> I'm generating (a lot of) GIFs with various number of frames in ROOT and
>
> I wanted to have a simple frame-by-frame viewer. Well, in a case if I
> call TImage::Open("anim.gif.N") with not existing frame N, how can I
> know that?
>
> Cheers,
>
> Vassili
>
> Olivier Couet wrote:
>
>
> Hi,
>
>
>
> In principle you should know that when you build the animated gif.
>
> Simply count them when you add them in the animation.
>
> Is your animated gif build outside ROOT ?
>
>
>
> Cheers, olviier
>
>
>
> -----Original Message-----
>
> From: owner-roottalk_at_root.cern.ch <mailto:owner-roottalk_at_root.cern.ch> [mailto:owner-roottalk_at_root.cern.ch]
>
> On Behalf Of Vassili Maroussov
>
> Sent: Friday, February 29, 2008 5:21 PM
>
> To: roottalk
>
> Subject: [ROOT] Number of frames in animated GIF
>
>
>
> Dear ROOTers,
>
>
>
> How to get number of frames in an animated GIF? I didn't find in the
>
> TSAImage a member function for that.
>
>
>
> Regards,
>
>
>
> Vassili
>
>
>
>
>
>
>
>
>
>
>
>
Received on Mon Mar 03 2008 - 15:49:16 CET

This archive was generated by hypermail 2.2.0 : Mon Mar 03 2008 - 17:50:01 CET