On the HTC One M8 you can create animated GIF files by attaching the captured continuous shots automatically. To create GIF file on HTC One M8 do as follows:
1. Open Camera application and make sure Continuous Shooting is enabled (Settings >> Continuous Shooting)
2. Now Press and Hold your finger on the shutter button to start taking continuous shots from the scene/object you'd like to create an Animated GIF from.
3. When finished, go to Gallery and open the already taken shots
4. Tap the Edit button
5. On the Effect option, tap the GIF CREATOR option (you may swipe available options to find it)
6. Use the trim sliders to specify the start and end points and tap Next.
7. Now before tapping the Save button on the top left, you can apply Filters, Change the Speed, or even play the GIF animation backward.
8. Tap the Save and the created GIF File is available in the Gallery and you may share it.