How does this animated png work?

1

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?

Rob

Posted 2013-07-10T15:38:29.427

Reputation: 385

Answers

5

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.

slhck

Posted 2013-07-10T15:38:29.427

Reputation: 182 472

2The 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 – 2013-07-10T15:50:44.537

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 – 2013-07-10T15:57:31.937

2

Just becuase 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.

Mxx

Posted 2013-07-10T15:38:29.427

Reputation: 2 659

In firefox, try to "save image" and it gets the name imgancnt.png.gif which is another clue. – Glenn Randers-Pehrson – 2015-12-18T01:02:15.040