{"id":9073,"date":"2011-11-21T07:00:00","date_gmt":"2011-11-21T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2011\/11\/21\/why-not-use-animated-gifs-as-a-lightweight-alternative-to-avis-in-the-animation-common-control\/"},"modified":"2011-11-21T07:00:00","modified_gmt":"2011-11-21T07:00:00","slug":"why-not-use-animated-gifs-as-a-lightweight-alternative-to-avis-in-the-animation-common-control","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20111121-00\/?p=9073","title":{"rendered":"Why not use animated GIFs as a lightweight alternative to AVIs in the animation common control?"},"content":{"rendered":"<p>Commenter Vilx- wondered <a href=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2009\/04\/17\/9553626.aspx#9554397\"> why animated GIFs weren&#8217;t used as the animation format for the shell animation common control<\/a>. After all, &#8220;they are even more lightweight than AVIs.&#8221;\n Animated GIFs are certainly more lightweight than general AVIs, since AVI is just a container format, so decoding a general AVI means decoding any encoding format invented now or in the future. On the other hand, the shell common control imposed enough limits on the type of AVIs it could handle to the point where what was left was extremely lightweight, certainly much more lightweight than an animated GIF.\n Think about it: To use an animated GIF, you need a GIF decoder. And a GIF decoder is already significantly larger (both in terms of code and memory) than the RLE-8 decoder. Also significantly more complicated, and therefore <a href=\"http:\/\/www.bing.com\/search?q=gif+vulnerability\"> significantly more likely to have bugs<\/a>. Whereas RLE-8 is so simple there isn&#8217;t much that can go wrong, and the RLE-8 decoder had been around since Windows&nbsp;3.0, so it was already a known quantity. <a href=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2009\/04\/08\/9537051.aspx\"> All you have to do to invoke the RLE-8 decoder is call <code>Set&shy;DI&shy;Bits&shy;To&shy;Device<\/code><\/a>. One line of code is hard to beat.\n Windows&nbsp;95 did not come with a GIF decoder. Remember, Internet Explorer&nbsp;1.0 did not come with Windows&nbsp;95; it was part of the Plus! pack. As I recall, at the time Windows&nbsp;95 released to manufacturing, the Plus! pack was still under development. (And at the time the animation common control was being designed, Internet Explorer didn&#8217;t exist. Heck, <i>Mosaic<\/i> didn&#8217;t exist!) Plus the fact that the common controls were available in both 16-bit and 32-bit versions&mdash;in fact it was the 16-bit versions that were written first since Windows&nbsp;95 didn&#8217;t have good Win32 support at the start of the project. More accurately, Windows&nbsp;95 didn&#8217;t have <i>any<\/i> Win32 support at the start of the project.<\/p>\n<p> So I&#8217;m kind of amused by the description of GIF as a lightweight animation encoding algorithm. <a href=\"http:\/\/www.fileformat.info\/format\/bmp\/corion-rle8.htm\"> Compared to RLE<\/a>, <a href=\"http:\/\/en.wikipedia.org\/wiki\/Graphics_Interchange_Format#Animated_GIF\"> the GIF format<\/a> weighs a ton! <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Commenter Vilx- wondered why animated GIFs weren&#8217;t used as the animation format for the shell animation common control. After all, &#8220;they are even more lightweight than AVIs.&#8221; Animated GIFs are certainly more lightweight than general AVIs, since AVI is just a container format, so decoding a general AVI means decoding any encoding format invented now [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[2],"class_list":["post-9073","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-history"],"acf":[],"blog_post_summary":"<p>Commenter Vilx- wondered why animated GIFs weren&#8217;t used as the animation format for the shell animation common control. After all, &#8220;they are even more lightweight than AVIs.&#8221; Animated GIFs are certainly more lightweight than general AVIs, since AVI is just a container format, so decoding a general AVI means decoding any encoding format invented now [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/9073","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=9073"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/9073\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=9073"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=9073"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=9073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}