Loading a image and copying the metadata of a jpeg image.
- by Ravi shankar
I am trying to load a jpeg image and trying to copy metadata to new image, but the new image is created with out any metadata. Can some one help me out in solving above problem. I am using C++ CLI 3.5.
if (System::IO::Stream ^jpegStreamIn = File::Open(FileMyPictures, FileMode::Open, FileAccess::ReadWrite, FileShare::None))
{
decoder = gcnew System::Windows::Media::Imaging::JpegBitmapDecoder(jpegStreamIn,
System::Windows::Media::Imaging::BitmapCreateOptions::PreservePixelFormat,
System::Windows::Media::Imaging::BitmapCacheOption::OnLoad);
jpegStreamIn->Close();
}
bitmapFrame = decoder->Frames[0];
metadata = (System::Windows::Media::Imaging::BitmapMetadata^)bitmapFrame->Metadata;