Note that there are some explanatory texts on larger screens.

plurals
  1. POImage.FromStream don't work the same way on my new windows installation
    text
    copied!<p>I've got this test that used to works on my old machine. (Windows Vista Ultimate 32-bit)</p> <pre><code>private static readonly byte[] TEST_BMP = new byte[] { 0x42, 0x4D, 0x7E, 0, 0, 0, 0, 0, 0, 0, 0x76, 0, 0, 0, 0x28, 0, 0, 0, 0x2, 0, 0, 0, 0x2, 0, 0, 0, 0x1, 0, 0x4, 0, 0, 0, 0, 0, 0x8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x80, 0, 0, 0x80, 0, 0, 0, 0x80, 0x80, 0, 0x80, 0, 0, 0, 0x80, 0, 0x80, 0, 0x80, 0x80, 0, 0, 0x80, 0x80, 0x80, 0, 0xC0, 0xC0, 0xC0, 0, 0, 0, 0xFF, 0, 0, 0xFF, 0, 0, 0, 0xFF, 0xFF, 0, 0xFF, 0, 0, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0xFF, 0, 0, 0xFF, 0xFF, 0xFF, 0, 0x40, 0, 0, 0, 0xF9, 0, 0 }; [Test] public void Can_get_Image_from_BMP_Stream() { using (var memStream = new MemoryStream(TEST_BMP)) { Image image = Image.FromStream(memStream); Assert.NotNull(image); } } </code></pre> <p>On my new machine (Windows 7 64-bit) it doesn't work anymore.</p> <p>I get this exception:</p> <pre><code>System.ArgumentException : Parameter is not valid. at System.Drawing.Image.FromStream(Stream stream, Boolean useEmbeddedColorManagement, Boolean validateImageData) at System.Drawing.Image.FromStream(Stream stream) at Litium.Framework.Image.Test.ImageManagerTests.Can_get_Image_from_BMP_Stream() </code></pre> <p>If I instead try with this it works...</p> <pre><code>private static readonly byte[] TEST_GIF = new byte[] { 0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x2, 0, 0x2, 0, 0x11, 0, 0, 0x2C, 0, 0 , 0, 0, 0x2, 0, 0x2, 0, 0xA1, 0xFF, 0, 0, 0xFF, 0xFF, 0xFF, 0, 0, 0, 0, 0, 0x80, 0x2, 0x3, 0xC, 0x26, 0x5, 0, 0x3B }; </code></pre> <p>Why doesn't this work on my new machine?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload