Platforms to show: All Mac Windows Linux Cross-Platform

Back to TiffPictureMBS class.

TiffPictureMBS.GetColorMap(byref red as memoryblock, byref green as memoryblock, byref blue as memoryblock) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method TIFF MBS Images Plugin 9.6 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries the color map for a paletten image.

The memoryblock must be 2^bitspersample * 2 bytes big.
Returns true on success and false on failure.

TiffPictureMBS.GetColorProfile as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method TIFF MBS Images Plugin 7.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the color profile data stored in the tiff file.
Example
Var f as FolderItem
Var t as TiffPictureMBS
Var s as string
Var p as LCMS2ProfileMBS

f=SpecialFolder.Desktop.Child("horsehead_steinberg_big.tif")

t=f.OpenAsTiffMBS

s=t.GetColorProfile

p = LCMS2ProfileMBS.OpenProfileFromString(s)

MsgBox p.Name

Returns "" on any error.

Some examples using this method:

TiffPictureMBS.GetData(Tag as Integer) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method TIFF MBS Images Plugin 8.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reads the string stored for this tag.

TiffPictureMBS.GetField(Tag as Integer, mem as memoryblock) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method TIFF MBS Images Plugin 7.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reads the value associated with the given tag id.

Please look for Tag values in the tiff specification.
Returns true on success.
Please make sure to use the correct setter depending on data type associated with the tag.
The memoryblock you pass in must be big enough to hold whatever data the library stores there.

TiffPictureMBS.GetFieldByte(Tag as Integer, byref value as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method TIFF MBS Images Plugin 8.7 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reads the value associated with the given tag id.

Please look for Tag values in the tiff specification.
Returns true on success.
Please make sure to use the correct setter depending on data type associated with the tag.

TiffPictureMBS.GetFieldCount(Tag as Integer, byref count as Integer, mem as memoryblock) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method TIFF MBS Images Plugin 8.7 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reads the value associated with the given tag id.
Example
'TIFF Tag ImageID
'
'IFD Image
'Code 32781 (hex 0x800D)
'Name ImageID
'Type ASCII
'Count N
'Default None
'Description
'
'OPI-related.
'
'ImageID is the full pathname of the original, high-resolution image, or any other identifying string that uniquely identifies the original image.
'
'The high-resolution image is not required to be in TIFF format. It can be in any format that an OPI Consumer wishes to support.

Var tiffImport As TiffPictureMBS
Var xx as string

tiffImport = New TiffPictureMBS
Call tiffImport.Open(SpecialFolder.Desktop.Child("test.tif"))

// the memoryblock is a storage for the data. In this case a pointer to the CString
Var m as MemoryBlock=NewMemoryBlock(4)
Var count as Integer

if tiffImport.GetFieldCount(32781, count, m) then
MsgBox str(count)
MsgBox m.Ptr(0).CString(0)
end if

tiffImport.close

This is the special version using memoryblock so you can use it for reading values with a count value.

Please look for Tag values in the tiff specification.
Returns true on success.
Please make sure to use the correct setter depending on data type associated with the tag.

TiffPictureMBS.GetFieldDefaultedByte(Tag as Integer, byref value as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method TIFF MBS Images Plugin 8.7 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reads the value associated with the given tag id.

Please look for Tag values in the tiff specification.
Returns true on success. May return a default value.
Please make sure to use the correct setter depending on data type associated with the tag.

GetFieldDefaulted* is identical to GetField*, except that if a tag is not defined in the current directory and it has a default value, then the default value is returned.

TiffPictureMBS.GetFieldDefaultedDouble(Tag as Integer, byref value as Double) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method TIFF MBS Images Plugin 7.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reads the value associated with the given tag id.

Please look for Tag values in the tiff specification.
Returns true on success. May return a default value.
Please make sure to use the correct setter depending on data type associated with the tag.

GetFieldDefaulted* is identical to GetField*, except that if a tag is not defined in the current directory and it has a default value, then the default value is returned.

TiffPictureMBS.GetFieldDefaultedInteger(Tag as Integer, byref value as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method TIFF MBS Images Plugin 7.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reads the value associated with the given tag id.

Please look for Tag values in the tiff specification.
Returns true on success. May return a default value.
Please make sure to use the correct setter depending on data type associated with the tag.

GetFieldDefaulted* is identical to GetField*, except that if a tag is not defined in the current directory and it has a default value, then the default value is returned.

TiffPictureMBS.GetFieldDefaultedShort(Tag as Integer, byref value as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method TIFF MBS Images Plugin 7.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reads the value associated with the given tag id.

Please look for Tag values in the tiff specification.
Returns true on success. May return a default value.
Please make sure to use the correct setter depending on data type associated with the tag.

GetFieldDefaulted* is identical to GetField*, except that if a tag is not defined in the current directory and it has a default value, then the default value is returned.

TiffPictureMBS.GetFieldDefaultedSingle(Tag as Integer, byref value as Single) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method TIFF MBS Images Plugin 8.7 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reads the value associated with the given tag id.

Please look for Tag values in the tiff specification.
Returns true on success. May return a default value.
Please make sure to use the correct setter depending on data type associated with the tag.

GetFieldDefaulted* is identical to GetField*, except that if a tag is not defined in the current directory and it has a default value, then the default value is returned.

TiffPictureMBS.GetFieldDefaultedString(Tag as Integer, byref value as String) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method TIFF MBS Images Plugin 8.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reads the value associated with the given tag id.
Example
Var t as TiffPictureMBS
Var f as FolderItem
Var s as string

f=SpecialFolder.Desktop.Child("ChristianSchmitz.tif")
t=f.OpenAsTiffMBS

const TIFFTAG_SOFTWARE=305

if t.GetFieldDefaultedString(TIFFTAG_SOFTWARE, s) then
MsgBox "TIFFTAG_SOFTWARE"+EndOfLine+s
end if

Please look for Tag values in the tiff specification.
Returns true on success. May return a default value.
Please make sure to use the correct setter depending on data type associated with the tag.
The string is returned with ascii encoding. You may need to define a different encoding is this is not correct.

GetFieldDefaulted* is identical to GetField*, except that if a tag is not defined in the current directory and it has a default value, then the default value is returned.

TiffPictureMBS.GetFieldDouble(Tag as Integer, byref value as Double) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method TIFF MBS Images Plugin 7.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reads the value associated with the given tag id.

Please look for Tag values in the tiff specification.
Returns true on success.
Please make sure to use the correct setter depending on data type associated with the tag.

TiffPictureMBS.GetFieldInteger(Tag as Integer, byref value as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method TIFF MBS Images Plugin 7.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reads the value associated with the given tag id.

Please look for Tag values in the tiff specification.
Returns true on success.
Please make sure to use the correct setter depending on data type associated with the tag.

TiffPictureMBS.GetFieldMemory(Tag as Integer, byref ItemCount as Integer) as memoryblock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method TIFF MBS Images Plugin 8.7 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reads the value associated with the given tag id.

This is the special version using memoryblock so you can use it for reading values with a count value.

Please look for Tag values in the tiff specification.
Returns true on success.
Please make sure to use the correct setter depending on data type associated with the tag.

Some examples using this method:

TiffPictureMBS.GetFieldShort(Tag as Integer, byref value as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method TIFF MBS Images Plugin 7.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reads the value associated with the given tag id.

Please look for Tag values in the tiff specification.
Returns true on success.
Please make sure to use the correct setter depending on data type associated with the tag.

TiffPictureMBS.GetFieldSingle(Tag as Integer, byref value as Single) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method TIFF MBS Images Plugin 8.7 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reads the value associated with the given tag id.

Please look for Tag values in the tiff specification.
Returns true on success.
Please make sure to use the correct setter depending on data type associated with the tag.

TiffPictureMBS.GetFieldString(Tag as Integer, byref value as string) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method TIFF MBS Images Plugin 8.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reads the value associated with the given tag id.
Example
Var t as TiffPictureMBS
Var f as FolderItem
Var s as string

f=SpecialFolder.Desktop.Child("test.tif")
t=f.OpenAsTiffMBS

const TIFFTAG_SOFTWARE=305

if t.GetFieldString(TIFFTAG_SOFTWARE, s) then
MsgBox "TIFFTAG_SOFTWARE"+EndOfLine+s
end if

const TIFFTAG_HOSTCOMPUTER=316

if t.GetFieldString(TIFFTAG_HOSTCOMPUTER, s) then
MsgBox "TIFFTAG_SOFTWARE"+EndOfLine+s
end if

const TIFFTAG_IMAGEDESCRIPTION=270

if t.GetFieldString(TIFFTAG_IMAGEDESCRIPTION, s) then
MsgBox "TIFFTAG_IMAGEDESCRIPTION"+EndOfLine+s
end if

const TIFFTAG_MAKE=271

if t.GetFieldString(TIFFTAG_MAKE, s) then
MsgBox "TIFFTAG_MAKE"+EndOfLine+s
end if

const TIFFTAG_ARTIST=315

if t.GetFieldString(TIFFTAG_ARTIST, s) then
MsgBox "TIFFTAG_ARTIST"+EndOfLine+s
end if

Please look for Tag values in the tiff specification.
Returns true on success. May return a default value.
Please make sure to use the correct setter depending on data type associated with the tag.
The string is returned with ascii encoding. You may need to define a different encoding is this is not correct.

Some examples using this method:

TiffPictureMBS.GetXMP as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method TIFF MBS Images Plugin 7.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the xmp metadata package stored in the tiff file.
Example
Var f as FolderItem
Var t as TiffPictureMBS
Var s as string

f=SpecialFolder.Desktop.Child("test.tif")

t=f.OpenAsTiffMBS

s=t.GetXMP

MsgBox left(s,500)

Returns "" on any error.

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


The biggest plugin in space...