Probably because the file is not yet saved, and therefore Tridion can't determine its size?
You could try something like this instead:
MemoryStream ImageStream = new MemoryStream(Component.Multimedia.GetBinaryContent());
MMImage = Image.FromStream(ImageStream);
Component.MetadataFields[IMAGE_WIDTH_FIELD].value[1] = MMImage.Size.Width.ToString();
UPDATE
I wrote this for a 5.3 Event System, not sure it would work on later versions... What I do is I try to load the image from its "Multimedia Filename". This is the path that the image was uploaded from, but given that it might have been uploaded from a client's workstation, the file may not exist on the server. In that case, I try to load the image from the web\upload folder (where the Tridion CME would have copied the image to before saving it in a component).
Image image = null;
if(Component.Info.Version < 1) // New Component
{
string fileName = null;
string uploadFolder = null;
if(!File.Exists(Component.Multimedia.Filename))
{
uploadFolder = GetTridionInstallPath() + @"web\Upload\"; //Dragons be here
fileName = uploadFolder + Path.GetFileName(Component.Multimedia.Filename);
}
else
{
fileName = Component.Multimedia.Filename;
}
if(File.Exists(fileName))
{
FileStream imageStream = File.OpenRead(fileName);
image = Image.FromStream(imageStream);
}
else
{
logger.logEvent("Could not find file " + filename, EnumSeverity.severityInfo);
}
}
else
{
MemoryStream imageStream = new MemoryStream(Component.Multimedia.GetBinaryContent());
image = Image.FromStream(imageStream);
}
if(image != null)
{
try
{
Component.MetadataFields[IMAGE_WIDTH_FIELD].value[1] = MMImage.Size.Width.ToString();
Component.MetadataFields[IMAGE_HEIGTH_FIELD].value[1] = MMImage.Size.Height.ToString();
}
catch (Exception ex)
{
logger.logEvent("Could not get image dimensions, first version? Error: " + ex.ToString(), EnumSeverity.severityError);
}
}