Reading JPEG Thumbnails from EXIF
Here some sample code:
Dim file As FolderItem = SpecialFolder.Desktop.Child("test.jpg")
// first read header and check for thumbnail in EXIF
Dim j As New JPEGImporterMBS
j.file = file
j.ReadExifData = True
If j.ReadHeader Then
Dim thumbnailData As String = j.ExifThumbnail
If thumbnailData.LenB > 0 Then
thumbnailPic = picture.FromData(thumbnailData)
End If
// now read a scaled down image
Dim factor As Double = Min( j.Height / 300.0, j.Width / 300.0)
If factor >= 8.0 Then
j.ScaleFactor = 8
Elseif factor >= 4.0 Then
j.ScaleFactor = 4
Else
j.ScaleFactor = 2
End If
j.Import
Pic2 = j.Picture
// finally read full image
j.ScaleFactor = 0
j.Import
Pic3 = j.Picture
Else
MsgBox j.ErrorMessage
End If
Coming soon for MBS Plugins version 20.1pr5. See also CGImageSourceMBS class for MacOS to get quickly thumbnails for various image formats.