Platforms to show: All Mac Windows Linux Cross-Platform
Required plugins for this example: MBS Images Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Images/JPEG/Exif Thumbnails
This example is the version from Sun, 22th Feb 2020.
Project "Exif Thumbnails.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
EventHandler Sub Open()
// walk over folder and look for thumbnails
Dim folder As FolderItem = SpecialFolder.Pictures // .Child("Bilder")
Dim c As Integer = folder.Count
For i As Integer = 1 To c
Dim f As FolderItem = folder.TrueItem(i)
If f.Directory Then
// ignore folder
Elseif f.name.Right(4) = ".jpg" Then
System.DebugLog "Check "+f.name
Dim g As New JPEGImporterMBS
g.File = f
g.ReadExifData = True
// not load, but just read header & metadata
If g.ReadHeader Then
// get thumbnail
Dim Thumbnail As String = g.ExifThumbnail
// show it
If Thumbnail.LenB > 0 Then
Dim w As New ImageWindow
w.Title = g.file.name
w.Backdrop = picture.FromData(Thumbnail)
// if nil, use ScaleFactor and read scaled down version
Else
System.DebugLog "No thumbnail for: "+f.name
End If
End If
End If
Next
If WindowCount = 0 Then
MsgBox "No image found with thumbnail."
End If
AutoQuit = True
End EventHandler
End Class
Class ImageWindow Inherits Window
End Class
MenuBar MainMenuBar
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem EditSeparator1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem EditSeparator2 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
End Project
The items on this page are in the following plugins: MBS Images Plugin.