Me: I live in Silicon Valley with my wife, child and cat. I have worked at Microsoft since I graduated from College, both in the Macintosh Business Unit on products such as Outlook Express, Entourage, IE, and Virtual PC and in Windows Live on Hotmail, Calendar and People. I am currently a Principal Lead Program Manager on the Windows Live Social Networking team. I basically manage a team of Program Managers responsible for delivering features to support our web and client applications. I've been blogging since 2001 and like to play around with .NET in my spare time working on projects such as dasBlog (the blog that powers this site) and Send to SmugMug (an application for uploading photos to SmugMug). I blog about a number of technology and productivity related topics.
Powered by: newtelligence dasBlog 2.3.9074.18820
Disclaimer The posts on this weblog are provided "AS IS" with no warranties, and confer no rights. The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2010, Omar Shahine
E-mail
A few months ago I encountered a significant performance problem with System.Drawing.Imaging.
I found that by using the new Method performance was 93x faster (on average) for loading jpegs.
You can download the update here:
http://www.microsoft.com/downloads/details.aspx?FamilyID=a8f5654f-088e-40b2-bbdb-a83353618b38&DisplayLang=en
Specifically, this update adds a new method to System.Drawing.Imaging:
System.Drawing.Image.FromStream(Stream stream, bool useICM, bool validateImageData)
This is essentially a new signature for an existing method:
System.Drawing.Image.FromStream(Stream stream, bool useICM)
As you can see, validateImageData is a new parameter. Setting it to true is the default behavior that we have today (essentially the same as calling FromStream(Stream stream, bool useICM)).
So I made a change to my application. Before my code looked like this:
using (Image photo = Image.FromFile(this.fileInfo.FullName, true)) { //do stuff }
So I changed it to:
using (FileStream fs = new FileStream(this.fileInfo.FullName, FileMode.Open, FileAccess.ReadWrite)) { using (Image photo = Image.FromStream(fs, true, false)) { // do stuff } }