locked
Remove image metadata RRS feed

  • Question

  • User1510859543 posted

    We use the code below to stream an image to a reduced size jpg file and our customer was wondering if there is a way to remove the images metadata (date/time taken, etc.) when we import.  Thanks.

                        Dim filePath As String = strFolderPath & "\" & strFileName
                        If File.Exists(filePath) = False Then
                            'If Image is less that 800KB then move it
                            'otherwise stream it to a smaller file.
                            If fi.Length < 800000 Then
                                fi.MoveTo(filePath)
                            Else
                                Dim bmpImg As Bitmap = Nothing
                                Using fileStream As FileStream = File.OpenRead(strFilePath)
                                    Dim memStream As New MemoryStream()
                                    memStream.SetLength(fileStream.Length)
                                    fileStream.Read(memStream.GetBuffer(), 0, CInt(fileStream.Length))
                                    bmpImg = FilesClass.Resize_Image(fileStream, 2533, 1900)
    
                                    bmpImg.Save(filePath, ImageFormat.Jpeg)
                                    fileStream.Close()
                                    fileStream.Dispose()
                                    File.Delete(strFilePath)
                                End Using
                            End If
    
                        End If
    

    Tuesday, May 22, 2018 5:22 PM

All replies