<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d8211560\x26blogName\x3dTech+Tips,+Tricks+%26+Trivia\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttp://mvark.blogspot.com/search\x26blogLocale\x3den\x26v\x3d2\x26homepageUrl\x3dhttp://mvark.blogspot.com/\x26vt\x3d-5147029996388199615', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Tech Tips, Tricks & Trivia

by 'Anil' Radhakrishna
An architect's notes, experiments, discoveries and annotated bookmarks.

Search from over a hundred HOW TO articles, Tips and Tricks


HOW TO differentiate between GIFs & animated GIFs programmatically

"There are 2 kinds of people on the Web - voyeurs and exhibitionists."
Michael Detouzos, MIT

In my Classic ASP days, I managed a portal that was free for all. During this period I understood how important it is to monitor the website continously to stay ahead of smart-alecky visitors who try to attract attention with suggestive usernames or doing something whacky. A common prank that is played is to harass nice folks in the online community by creating a username with a underscore prefixed to some other nice guy's name (the underscore is hardly noticeable if the word is hyperlinked) & misusing his identity. And if a website offers members to upload any files, you can be assured that some vandals will be upto some mischief. All file uploads should ideally be validated & published only after moderation.

Ok, now let me cut to the chase :-). There was a question recently on the ASP.NET Forums that struck a chord. A poster wanted to know whether it was possible to programmatically find if a image being uploaded by the user was a plain GIF or a animated GIF so that he could prevent animated images. After a little searching with my custom search-engine, I found a nice article with C# code to determine if an image contains animation frames.

Labels: , ,

Tweet this | Google+ it | Share on FB

« Home | Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »

»

Post a Comment