title: Html/Javascript image does not take image of type pnm
body: <p>I need an advice for an issue with html/javascript images. It seems that is not possible to load images of type pnm. 
  I did test the following example code with Chrome, Internet Explorer and Firefox. It always produces the same problem. Images of type jpg, png, etc. are loaded and displayed correctly. For images of type pnm the onload function of the image never gets called. Therefore I assume that this image type cannot be loaded.</p>
  
  <p>Images of type pnm are described as: image/x-portable-anymap;base64</p>
  
  <p>Please see this piece of code:</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /&gt;
  &lt;title&gt;Image preview example&lt;/title&gt;
  &lt;script type="text/javascript"&gt;
  oFReader = new FileReader();
  oFReader.onload = function (oFREvent) {
    console.log("image now loading");
    document.getElementById("uploadPreview").onload = function() { console.log("image successfully loaded");};
    document.getElementById("uploadPreview").src = oFREvent.target.result;
      };
  function loadImageFile() {
    console.log("image selected");
    if (document.getElementById("uploadImage").files.length === 0) { return; }
    var oFile = document.getElementById("uploadImage").files[0];
    oFReader.readAsDataURL(oFile);
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;form name="uploadForm"&gt;
      &lt;table&gt;
        &lt;tbody&gt;
          &lt;tr&gt;
            &lt;td&gt;&lt;img id="uploadPreview" style="width: 100px; height: 100px;" alt="Image preview" /&gt;&lt;/td&gt;
            &lt;td&gt;&lt;input id="uploadImage" type="file" name="myPhoto" onchange="loadImageFile();" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
      &lt;p&gt;&lt;input type="submit" value="Send" /&gt;&lt;/p&gt;
    &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I wonder about this behaviour since pnm ist the most simple and most straight forward image format that exists. It only consists of sizes and pixel data.</p>
  
  <p>Does anybody know how to alter the example code in order to make it work for pnm images?</p>
  
  <p>First price would be a code change. Second price a free browser plugin. I simply would not like to use an additional library or third party code.
  Any code correction, no matter how calculation-intensive it is, is welcomed.</p>