I have a component for an image file upload.
However, I want to also be able to check DPI settings because these images will eventually be printed and submitted on paper.
Within ASP.net, I can usually do something like this:
using (var rawBitmap = new Bitmap(postedFile.InputStream)){
var dpi = (decimal)rawBitmap.VerticalResolution/bitmap.Height;
// do other stuff.
}
However, within silverlight, I don't have access to the same libraries in order to do this (that said, this is my first stab at Silverlight, so if there is a way to get those dlls in, I'm all for it, but I couldn't get my utility wrapper imported).
I've seen lots of recommendations for FJcore (imagetools also wraps this library), a JPEG encoding/decoding utility. In theory, one loads up the JPEG stream into the decoder and gets information out.
I've tried using the approach with FJcore, but all the files that I'm saving out of photoshop seem to be missing the correct header that indicates the star of the file, which causes the decoder to fail. I've also confirmed this issue using their unit tests.
Any ideas on how to pull image resolution out of a file upload in silverlight?