Platforms to show: All Mac Windows Linux Cross-Platform

Back to JPEGImporterMBS class.

JPEGImporterMBS.AllowDamaged as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
whether you want damaged pictures to be returned.

If AllowDamaged is false, nil will be returned if the picture is damaged.
Default value is false.
(Read and Write property)

JPEGImporterMBS.BlockSmoothing as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 12.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether to do interblock smoothing.

Default value is true.

This setting is relevant only when decoding a progressive JPEG image. During the first DC-only scan, block smoothing provides a very "fuzzy" look instead of the very "blocky" look seen without it; which is better seems a matter of personal taste. But block smoothing is nearly always a win during later stages, especially when decoding a successive-approximation image: smoothing helps to hide the slight blockiness that otherwise shows up on smooth gradients until the lowest coefficient bits are sent.
(Read and Write property)

JPEGImporterMBS.CMYK as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 3.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether the decompressor has imported the picture as a CMYK image into a memoryblock.
Example
dim g as FolderItem
dim ji as JPEGImporterMBS

g=getFolderItem("a_auf")
ji=new JPEGImporterMBS
ji.File=g
if ji.InitJPEG then

if ji.CMYK then
MsgBox "CMYK"
else
MsgBox "not"
end if
end if

This property sets the Mode property to ModeCMYK.
(Read and Write property)

JPEGImporterMBS.ColorComponentCount as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 3.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The number of color components.

1Grayscale
3RGB
4CMYK
(Read and Write property)

Some examples using this property:

JPEGImporterMBS.ColorSpace as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 13.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The color space of the image.
Example
dim j as new JPEGImporterMBS

j.File = SpecialFolder.Desktop.Child("cmyk.jpg")

if j.InitJPEG then

Select case j.ColorSpace
case j.ColorSpaceCMYK, j.ColorSpaceYCCK
MsgBox "CMYK"
case j.ColorSpaceRGB, j.ColorSpaceYCbCr
MsgBox "RGB"
case j.ColorSpaceGrayScale
MsgBox "Gray"
else
MsgBox "unknown? "+str(j.ColorSpace)
end Select

j.FinishJPEG
end if

See also the Colorspace constants.
(Read and Write property)

JPEGImporterMBS.CurrentDepth as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The depth of the picture property.

In the current implementation always 32bit.
0 if the loading of the picture failed.
(Read and Write property)

Some examples using this property:

JPEGImporterMBS.data as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The source string.

If file is nil, the compressed data is taken from this property.
(Read and Write property)

JPEGImporterMBS.ErrorMessage as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The last error message reported.

(Read and Write property)

JPEGImporterMBS.ExifData as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The exif data stored in the file.
Example
dim j as JPEGImporterMBS
dim f as FolderItem

f=SpecialFolder.Desktop.Child("test.jpg")
j=new JPEGImporterMBS

j.ReadExifData=true // needed to fill ExifData property

// do the import

dim data as string = j.ExifData

// work with data

Only used when ReadExifData is set to true before you import the image.
The string contains the binary content of a exif data on disc.
Value is "" if no data was found.
(Read and Write property)

JPEGImporterMBS.ExifOrientation as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 20.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries orientation from EXIF data.

ReadExifData property must be set earlier to have the import process load EXIF data.
Returns -1 in case of error.
Valid values are in range of 1 to 8. See kOrientation* constants.

For new development, please use ExifTagsMBS class instead.
(Read only property)

Some examples using this property:

JPEGImporterMBS.ExifThumbnail as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 20.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Extracts an embedded thumbnail in EXIF data.
Example
Dim g As New JPEGImporterMBS

g.File = SpecialFolder.Desktop.Child("test.jpg")
g.ReadExifData = True

// not load, but just read header & metadata
If g.ReadHeader Then

// get thumbnail
Dim Thumbnail As String = g.ExifThumbnail

// show it
window1.Backdrop = picture.FromData(Thumbnail)

// if nil, use ScaleFactor and read scaled down version
End If

ReadExifData property must be set earlier to have the import process load EXIF data.
Returns string containing JPEG compressed image data.

For new development, please use ExifTagsMBS class instead.
(Read only property)

JPEGImporterMBS.FancyUpsampling as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 12.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether to do fancy upsampling.

Default value is true.

If true, use direct DCT scaling with DCT size > 8 for downsampling of chroma components. If false, use only DCT size <= 8 and simple separate downsampling. Default is true. For better image stability in multiple generation compression cycles it is preferable that this value matches the corresponding FancyUpsampling value in decompression.
(Read and Write property)

JPEGImporterMBS.file as folderitem

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The source file.
Example
Dim ji As New JPEGImporterMBS

ji.file = SpecialFolder.Desktop.Child("test.jpg")
ji.Import

Backdrop = ji.Picture

If file is nil and path is "", the source is taken from the data property.
(Read and Write property)

JPEGImporterMBS.FileOffset as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The offset inside the file.

(Read and Write property)

JPEGImporterMBS.Height as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The height of the picture.

0 if the loading of the picture failed.
(Read and Write property)

JPEGImporterMBS.HorizontalResolution as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 3.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The horizontal resolution.

(Read and Write property)

JPEGImporterMBS.Mode as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 8.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The operation mode.

Can be either ModePicture (Default), ModeRGB or ModeCMYK.
(Read and Write property)

JPEGImporterMBS.OriginalDepth as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The original depth of the picture.

Value maybe 8 for grayscale pictures and 24 or 32 for colored pictures.
0 if the loading of the picture failed.
(Read and Write property)

JPEGImporterMBS.Path as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 19.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The source file.
Example
Dim ji As New JPEGImporterMBS

// try with path
Dim f As FolderItem = SpecialFolder.Desktop.Child("test.jpg")
ji.path = f.NativePath
ji.Import

Backdrop = ji.Picture

If file is nil and path is "", the source is taken from the data property.
(Read and Write property)

JPEGImporterMBS.Picture as Picture

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The picture as the result.

Set to nil on any error.
(Read and Write property)

JPEGImporterMBS.PictureData as MemoryBlock

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 3.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The cmyk picture data after importing.
Example
dim g as FolderItem
dim ji as JPEGImporterMBS
dim je as JPEGExporterMBS
dim f as FolderItem
dim m as MemoryBlock

// import it
g=getFolderItem("CMYK Example.jpg")
ji=new JPEGImporterMBS
ji.File=g
ji.AllowDamaged=true
ji.ImportCMYK

m=ji.PictureData
msgBox g.name
// export it
f=SpecialFolder.Desktop.child("CMYK Example2.jpg")
je=new JPEGExporterMBS
je.File=f
je.Quality=75
je.ExportCMYK m, ji.Width, ji.Height, ji.Width*4

Basicly a memoryblock with one byte for each channel.
For ReadByRow methods this property contains memoryblock for a row of the image.
(Read and Write property)

JPEGImporterMBS.ProfileData as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 7.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The ICC profile stored in the file.
Example
dim f as FolderItem
dim j as JPEGImporterMBS
dim p as LCMS2ProfileMBS

f=SpecialFolder.Desktop.Child("test2.jpg")
j=new JPEGImporterMBS

j.ReadMarkers=true // else no metadata is read at all
j.ReadProfileData=true // needed to fill ProfileData property
j.file=f

j.Import

if j.ProfileData="" then
MsgBox "no profile"
Return
end if

p=LCMS2ProfileMBS.OpenProfileFromString(j.ProfileData)
MsgBox p.Name

Only used when ReadProfileData is set to true before you import the image.
The string contains the binary content of a profile file on disc. So you can pass it to the CMOpenProfileFromDataMBS function or write it to a file using the binarystream class.
Value is "" if no profile was found.
(Read and Write property)

JPEGImporterMBS.ProgressiveMode as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 18.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether this is a progressive jpeg file.

Loading progressive files needs more memory.
(Read and Write property)

JPEGImporterMBS.ReadExifData as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether the plugin should read in the exif data.
Example
dim j as JPEGImporterMBS
dim f as FolderItem

f=SpecialFolder.Desktop.Child("test.jpg")
j=new JPEGImporterMBS

j.ReadExifData=true // needed to fill ExifData property

// do the import

dim data as string = j.ExifData

// work with data

If there is exif data, it will be stored in the ExifData property.
Setting this value to true will set ReadMarkers to true, too.
The data is stored in one or more markers, so it is needed to read them before extracting the data.
(Read and Write property)

Some examples using this property:

JPEGImporterMBS.ReadMarkers as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 6.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether importer should read markers.
Example
dim j as JPEGImporterMBS
dim f as FolderItem

f=SpecialFolder.Desktop.Child("test.jpg")
j=new JPEGImporterMBS

j.ReadMarkers=true // else no metadata is read at all

// do the import

MsgBox str(j.MarkerCount)

(Read and Write property)

Some examples using this property:

JPEGImporterMBS.ReadProfileData as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 7.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether the plugin should read in the icc profile.
Example
dim j as JPEGImporterMBS
dim f as FolderItem

f=SpecialFolder.Desktop.Child("test.jpg")
j=new JPEGImporterMBS

j.ReadProfileData=true // needed to fill ProfileData property

// do the import

dim Profile as string = j.ProfileData

// work with profile data

If there is a profile, it will be stored in the ProfileData property.
Setting this value to true will set ReadMarkers to true, too.
A profile is stored in one or more markers, so it is needed to read them before extracting the profile.
(Read and Write property)

Some examples using this property:

JPEGImporterMBS.ReadXMPData as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether the plugin should read in the xmp data.

If there is xmp data, it will be stored in the XMPData property.
Setting this value to true will set ReadMarkers to true, too.
The data is stored in one or more markers, so it is needed to read them before extracting the data.
(Read and Write property)

JPEGImporterMBS.ResolutionUnit as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 3.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The unit of the resolution properties.

Values:
0unknown
1dots per inch
2dots per cm
(Read and Write property)

JPEGImporterMBS.ScaleFactor as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 10.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The JPEG Library can scale down the picture on the fly.

Allowed values: 0, 1, 2, 4, 8
0 and 1 disable scaling.
Default valus is 0 for no scaling.
(Read and Write property)

JPEGImporterMBS.VerticalResolution as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 3.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The vertical resolution.

(Read and Write property)

JPEGImporterMBS.WarningMessage as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The last warning message reported.

(Read and Write property)

JPEGImporterMBS.Width as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The width of the picture.

0 if the loading of the picture failed.
(Read and Write property)

JPEGImporterMBS.XMPData as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The XMP Data stored in the file.

Only used when ReadXMPData is set to true before you import the image.
The string contains the binary content of a xmp data on disc.
Value is "" if no data was found.
(Read and Write property)

JPEGImporterMBS.YieldTicks as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property JPEG MBS Images Plugin 7.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
How much time is given back to Xojo for other ticks.
Example
dim j as JPEGImporterMBS // your importer
j.YieldTicks=6 // only use 1/10th of a second

If value is greater than zero, the application will yield to another RB thread after the given number of ticks have passed. 60 ticks are one second. Using a small value can slow down processing a lot while a big value keeps your application not responding to mouse clicks.
If you use this property with e.g. 6 as the value, you may also want to use this method in a thread so you can handle mouse events or let Xojo redraw a progressbar.
(Read and Write property)

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


The biggest plugin in space...