Under review

Loading JPEG to OxyImage

Dvojnik 5 years ago updated by Oystein Bjorke 5 years ago 1
I have trouble loading JPEG images to OxyImage. I am using C# and WPF, OxyPlot version 2014.1.546.0 from NuGet. PNG and BMP images work great, but not JPEGs. I tried loading them using stream and bytearray

OxyImage image; 
FileStream stream = new FileStream(filepath, FileMode.Open);
image = new OxyImage(stream);

OxyImage image1;
byte[] imageArray = File.ReadAllBytes(filepath);
image1 = new OxyImage(imageArray);
Both without success (crashes on line with new OxyImage). I get this error message:

System.NotImplementedException was unhandled by user code HResult=-2147467263
Message=The method or operation is not implemented.
at OxyPlot.OxyImage.GetDecoder(ImageFormat format) in c:\projects\oxyplot\Source\OxyPlot\Imaging\OxyImage.cs:line 164
at OxyPlot.OxyImage.UpdateImageInfo() in c:\projects\oxyplot\Source\OxyPlot\Imaging\OxyImage.cs:line 260
at OxyPlot.OxyImage..ctor(Byte[] bytes) in c:\projects\oxyplot\Source\OxyPlot\Imaging\OxyImage.cs:line 48
at TemsaViewer01.PageXYGraph.LoadImages(Experiments exp) in d:\Cloud\VisualStudio\TemsaViewer01\TemsaViewer01\PageXYGraph.xaml.cs:line 101
at TemsaViewer01.PageXYGraph..ctor(Experiments exp) in d:\Cloud\VisualStudio\TemsaViewer01\TemsaViewer01\PageXYGraph.xaml.cs:line 53
at TemsaViewer01.MainWindow..ctor() in d:\Cloud\VisualStudio\TemsaViewer01\TemsaViewer01\MainWindow.xaml.cs:line 34
Can you give me some advice pleasse?

Under review
Sorry, support for JPEGs are not yet supported. It needs to read the width/height from the header...