resize anim gif

[email protected] ("[email protected]") Fri, 28 Mar 2008 12:11:22 +0100
Newsgroups php.gd.devel
Message-ID <[email protected]>
i'd like to resize gif containing multiple frames.
if i try this it only saves first frame :(

       FILE *fp=0;
       gdImagePtr im, im2;
       int width,height,error=0;
       fp = fopen("1.gif", "rb");
       if (!fp) return -1;
       im  = gdImageCreateFromGif(fp);
       fclose(fp);
       fp = fopen("2.gif", "wb");
       gdImageGif(im,fp);
       fclose(fp);
       gdImageDestroy(im);

someone possibly has that obviously terribly complex code that reads, 
resizes and saves all frames ?
i did find one solution with imagemagick convert, but it is surprisingly 
slow, way slower than imagemagick mogrify - which does not work correctly,
would gd version work ok, faster ?