Platforms to show: All Mac Windows Linux Cross-Platform

/XMP/Modify EXIF


Required plugins for this example: MBS XMP Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /XMP/Modify EXIF

This example is the version from Thu, 26th Mar 2014.

Project "Modify EXIF.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
EventHandler Sub Open() dim file as FolderItem = SpecialFolder.Desktop.Child("test.jpg") if not file.Exists then // please change file name above Break end if // use XMPFilesMBS to open file dim flags as integer = XMPFilesMBS.kOpenForUpdate dim xf as new XMPFilesMBS(file, XMPFilesMBS.kUnknownFile, flags) // now read the metadata dim xmp as new XMPMetaMBS dim PacketInfo as XMPPacketInfoMBS dim xmppacket as string if xf.GetXMP(xmp, xmppacket, PacketInfo) then // and dump to test file dim outputfile as FolderItem = SpecialFolder.Desktop.Child("before.txt") dim output as new MyXMPTextOutputMBS(outputfile) call xmp.DumpObject(output) // set a value like here a different GPS altitude xmp.SetProperty xmp.kNS_EXIF, "GPSAltitude", "24695/43" // and dump to test file outputfile = SpecialFolder.Desktop.Child("after.txt") output = new MyXMPTextOutputMBS(outputfile) call xmp.DumpObject(output) // update file if xf.CanPutXMP(xmp) then xf.PutXMP(xmp) xf.CloseFile(XMPFilesMBS.kUpdateSafely) else MsgBox "Can't update." end if end if End EventHandler
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
Class MyXMPTextOutputMBS Inherits XMPTextOutputMBS
EventHandler Function Output(text as string) As integer TextStream.Write text Return 0 // OK End EventHandler
Sub Constructor(file as FolderItem) self.file = file self.TextStream = TextOutputStream.Create(file) End Sub
Property TextStream As TextOutputStream
Property file As FolderItem
End Class
End Project

The items on this page are in the following plugins: MBS XMP Plugin.


The biggest plugin in space...