1

I am trying to rotate a GIF image in java.
I read these interresting two trails about rotating images in java : trail 1 , trail 2.

All works fine, except that when I rotate my GIF image, there is no more animation of the GIF image. Only the first image of the GIF animation is displayed.

So, is there any way to keep the GIF animation after rotating my GIF image, without using any third part library but only standard J2SE? Or will I be obliged to separate my GIF image into single images, rotate them one by one, and then display them in a loop?

I don't give any piece of code I wrote because it is not relevant in my humble opinion.

Community
  • 1
  • 1
Patrick B.
  • 1,257
  • 10
  • 18

1 Answers1

1

I think animated gifs work by storing multiple frames, all in the gif format. So you just need to apply you rotation method to every single image, instead of the whole gif.

Wikipedia has a quite nice description of the format

Celkoranor
  • 11
  • 1
  • I know an animated GIF work by storing multiple frames and I read the link about GIF format. But I still can't figure out a proper way to apply my rotation method to each frame of the animated GIF. Do you suggest to do that at the level of animated GIF bytes? How would you do that? I thinl of getting each – Patrick B. Mar 30 '13 at 07:48
  • I think of getting the bytes of each section describing a frame of the animated GIF, save it as a single image, rotate it and then replace in the animated GIF format. Its seems complicated and I even don't know if its possible... – Patrick B. Mar 30 '13 at 07:56