3

I have a web page that displays .gif images, I want to display only the first frame of the .gif (without animation) and I don't have a still version of it.

Is this possible?

UPDATE :

I want to make this on the client side. I don't have access to server (i.e) the server gives me .gif images and I want to display the first frame on my web page. Maybe there is a solution using javascript or css.

Martin Zikmund
  • 38,440
  • 7
  • 70
  • 91
confucius
  • 13,127
  • 10
  • 47
  • 66

1 Answers1

2

You may be able to use a JavaScript canvas as pointed out by Boldewyn in comments.

If that doesn't work out, I think you will have to do it server side. One tool that can do this is ImageMagick. However, that needs to be present on your server and PHP needs to be able to access it.

Command line usage:

convert 'image.gif[0]' singleframe.gif

I'm sure PHP's ImageMagick extension can do this as well.

Pekka
  • 442,112
  • 142
  • 972
  • 1,088