The following piece of source does run nicely with Windows up until vista.
With Windows 7 (and the new .net 3.5) it always produces an out of memory exception, when I try to load a raw image file from my Nikon D90.
Some might say "loading nef's is not supported", but it did run nicely up until vista, only Windows 7 broke it, so I'd disagree.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace QuickImageLoader
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
DialogResult res = openFileDialog1.ShowDialog();
if (res == DialogResult.OK)
{
pictureBox1.Image = Image.FromFile(openFileDialog1.FileName); // crash happens
pictureBox1.Refresh();
}
}
}
}
Download a sample nef file to reproduce error.
Is this a bug in Windows 7? In .net 3.5? Or is it something that should have never worked with XP/Vista?
[Update] Since a few people neither know nor read my introduction above: loading the nef like this does work on XP/Vista without installing the Nikon Raw Codec. And installing the codec does not solve the problem (folks, it got nothing to do with the codec sigh).