You can delete metadata using FreeImage, but for jpeg the image will be recompressed when saved with a corresponding loss in image quality.
' by default, FreeImage will have copied the metadata to the new image If Not (args.CopyMetadata) Then Dim tag As New FreeImageAPI.FITAG FreeImage.SetMetadata(FREE_IMAGE_MDMODEL.FIMD_COMMENTS, dib2, Nothing, tag) FreeImage.SetMetadata(FREE_IMAGE_MDMODEL.FIMD_IPTC, dib2, Nothing, tag) FreeImage.SetMetadata(FREE_IMAGE_MDMODEL.FIMD_XMP, dib2, Nothing, tag) ' value of 11 is for FIMD_EXIF_RAW FreeImage.SetMetadata(DirectCast(11, FreeImageAPI.FREE_IMAGE_MDMODEL), dib2, Nothing, tag) FreeImage.DeleteTag(tag) End If If File.Exists(targetFile) Then File.Delete(targetFile) End If FreeImage.Save(FREE_IMAGE_FORMAT.FIF_JPEG, dib2, targetFile, FREE_IMAGE_SAVE_FLAGS.JPEG_OPTIMIZE Or FREE_IMAGE_SAVE_FLAGS.JPEG_QUALITYGOOD)
If you want to remove metadata from file types other than FIF_JPEG, refer to the documentation to find out which ones can be written.
To remove metadata without affecting the image, you will need to view the jpeg file exchange format and pull out only the data you need. If you have the Photoshop 6 installation CD (6, not CS6) installed, a document with the appropriate information is available when installing the PS6 SDK.
source share