Check image transparency
<p>I have a website where people can upload an PNG image and save it. 
But before they can save it, i need a check if the image contains transparency. 
Is there an way to check (i prefer JavaScript) if an image is not 24 bits?</p>

<pre><code>&lt;img id="imageId" src=#" onload="checkRestriction(this,'1')" alt=""/&gt;

var isPng24Bit = false;

function checkRestriction(image, id) {
    if(image.colorDepth != 24) {
      PNGis24Bit = false;
    } else {
      PNGis24Bit = true; 
    }
}
</code></pre>