2

I've just received an email that contains a remotely hosted animated png. The png file is a countdown timer. Here is the URL:-

https://img.kickdyn.com/57/1MfiOGVFjvmaMMHd3VZv/imgancnt.png

Can someone please help me explain how this works? I would have expected that each time I load the file it would start playing fomr the same point, effectively resetting the countdown, but that seems not the be the case.

How does the PNG file know where to resume it's countdown from?

2 Answers 2

6

The image is a GIF (MIME type image/gif), and not a PNG like the URL suggests. You can check this by inspecting the response:

Cache-Control:private
Connection:keep-alive
Content-Length:292122
Content-Type:image/gif
Date:Wed, 10 Jul 2013 15:42:25 GMT
Server:Microsoft-IIS/7.5
X-AspNet-Version:4.0.30319
X-Powered-By:ASP.NET

Since a server can of course generate a GIF image—or any response—on the fly, it's not rocket science to generate an animated image with the matching countdown time and render this to the client.

2
  • 2
    The file in question includes 30 frames, so after 30 seconds the magic is over -- or the page where this image is embedded needs to reload it.
    – mpy
    Jul 10, 2013 at 15:50
  • Ah yes! I hadn't considered that it was dynamically generated each time. That must take a bit of a hit on the server.
    – Rob
    Jul 10, 2013 at 15:57
3

Just because it is named .png does not mean it is really png.

That image is a regular animated gif.

You can easily confirm that either by:

  • looking at the raw file itself and if you understand its structure, you'll plainly see it is gif.
  • looking in your browser at server's headers and see that it says Content-Type:image/gif.
1
  • 1
    In firefox, try to "save image" and it gets the name imgancnt.png.gif which is another clue. Dec 18, 2015 at 1:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .