none
How to convert camera raw file to jpg file without losing metadata

    Question

  • I'm using following codes that I got from internet searching.

    (code)

        Public Function memStreamFull(ByVal cFullPath As String)
            Dim bmpDec = BitmapDecoder.Create(New Uri(cFullPath), BitmapCreateOptions.DelayCreation, BitmapCacheOption.None)
            Dim bmpEnc = New JpegBitmapEncoder
            bmpEnc.QualityLevel = 100
            bmpEnc.Frames.Add(bmpDec.Frames(0))
            Using ms As New MemoryStream
                bmpEnc.Save(ms)

                bmpDec = Nothing
                bmpEnc = Nothing
                Return Image.FromStream(ms)
            End Using
        End Function

    It works fine.

    But this code has two problems.

    One is lost metadata of raw file.

    The other one is displaying "not enough memory".

    Any one who has solution, please help me.

    Thank you.


    Wednesday, March 22, 2017 12:37 PM

All replies

  • Please refer to this case.

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/442d6f68-90c1-4926-82de-2965d67a2846/vbnet-convert-rawimagedata-into-image-file-jpg-but?forum=vbgeneral

    Friday, March 24, 2017 9:58 AM