Example: /XMP/Modify EXIF

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

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.


💬 Ask a question or report a problem