![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | writing exif data I am resizing a jpeg file and want to add some exif data. But the data is not written. If I use windows explorer there is nothing in the properties and if I read again via WPF there is nothing. If I set properties with windows explorer I can read them with WPF. Is there anything wrong with the code? How do I write exif data correctly? BitmapImage biPreview = new BitmapImage(); biPreview.BeginInit(); biPreview.UriSource = new Uri(local0, UriKind.Absolute); biPreview.DecodePixelHeight = h; biPreview.DecodePixelWidth = w; biPreview.EndInit(); BitmapMetadata bmmd = new BitmapMetadata("jpg"); bmmd.Title = title; BitmapFrame bmFrame = BitmapFrame.Create(biPreview, null, bmmd, new System.Collections.ObjectModel.ReadOnlyCollection<ColorContext>( col)); bmFrame = BitmapFrame.Create(biPreview); JpegBitmapEncoder enc = new JpegBitmapEncoder(); enc.QualityLevel = 70; enc.Frames.Add(bmFrame); //write to filestream enc.Save(fs); fs.Close(); |
My System Specs![]() |
| | #2 (permalink) |
| | Re: writing exif data > BitmapMetadata bmmd = new BitmapMetadata("jpg"); > bmmd.Title = title; > > BitmapFrame bmFrame = BitmapFrame.Create(biPreview, null, bmmd, new > System.Collections.ObjectModel.ReadOnlyCollection<ColorContext>( col)); > bmFrame = BitmapFrame.Create(biPreview); This code is off course unbelievable stupid... the last line will discard the metadata. But if I get rid off this line I get a COMException (0xc0000005) on enc.Save(fs); If I use bmmd.SetQuery("/app1/ifd/{uint=270}", title); bmmd.SetQuery("/app1/ifd/exif/{uint=37510}", title); and do not use bmmd.Title = title; the metadata gets saved (although not visible for Windows explorer, but I can do without that). |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Displaying Exif Comments in Photo Gallery | Vista music pictures video | |||
| Change EXIF and File dates | PowerShell | |||
| Best way to set EXIF data in JPEGs | PowerShell | |||
| Vista to search exif data? | Vista General | |||
| Edit EXIF tags in Vista? | Vista music pictures video | |||