Platforms to show: All Mac Windows Linux Cross-Platform

Back to PNGReaderMBS class.

PNGReaderMBS.AllowDamaged as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property PNG MBS Images Plugin 11.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether to return picture for files with damaged content.

e.g. a half downloaded PNG file can still be processed and may give you a preview for the file.
(Read and Write property)

PNGReaderMBS.BitDepth as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property PNG MBS Images Plugin 9.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The bit depth of the PNG file.

The original value from file headers, not updated by ApplyOptions, even if we convert e.g. 1 bit to gray for you.
(Read and Write property)

PNGReaderMBS.ChunkCacheMax as UInt32

Type Topic Plugin Version macOS Windows Linux iOS Targets
property PNG MBS Images Plugin 20.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The maximum cache size for caching chunks.

The PNG specification sets no limit on the number of ancillary chunks allowed in a PNG datastream. By default, libpng imposes a limit of a total of 1000 sPLT, tEXt, iTXt, zTXt, and unknown chunks to be stored.
You can change the limit on the total number of such hunks that will be stored, with this property, where &h7fffffff means unlimited.
(Read and Write property)

PNGReaderMBS.ChunkMallocMax as UInt64

Type Topic Plugin Version macOS Windows Linux iOS Targets
property PNG MBS Images Plugin 20.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The maximum allocation size for one chunk.
Example
dim png as new PNGReaderMBS
png.chunkMallocMax=32 * 1024 * 1024

Libpng imposes a limit of 8 Megabytes (8,000,000 bytes) on the amount of memory that a compressed chunk other than IDAT can occupy, when decompressed.
You can query or change this limit with with this property.
Any chunks that would cause either of these limits to be exceeded will be ignored.
(Read and Write property)

PNGReaderMBS.ColorType as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property PNG MBS Images Plugin 9.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The color type of the PNG file.

The value is a combination of this constants:
PNG_COLOR_MASK_PALETTE= 1
PNG_COLOR_MASK_COLOR= 2
PNG_COLOR_MASK_ALPHA= 4

The PNG library will convert on reading every row into 32bit RGBA, so don't worry about this.

The OriginalColorType property is the color type of the file. ColorType property reports what ApplyOptions changed it to, so you know what ReadRow will put in the MemoryBlock.
(Read and Write property)

Some examples using this property:

PNGReaderMBS.CompressionBufferSize as UInt64

Type Topic Plugin Version macOS Windows Linux iOS Targets
property PNG MBS Images Plugin 20.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The zlib compression buffer size.

You can change the zlib compression buffer size to be used while reading compressed data with this property where the default size is 8192 bytes. Note that the buffer size is changed immediately and the buffer is reallocated immediately, instead of setting a flag to be acted upon later.
(Read and Write property)

PNGReaderMBS.ExpandGrayToRGB as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property PNG MBS Images Plugin 19.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether grayscale images are expanded to RGB.

Set before ApplyOptions if you need this option.
Default is true.

Shall set transformations such that the grayscale image is converted to 24-bit RGB.

see png_set_gray_to_rgb function in libpng documentation.
(Read and Write property)

Some examples using this property:

PNGReaderMBS.HasTransparency as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property PNG MBS Images Plugin 19.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether a transparency block is included for palette images (tRNS).

Set by ReadHeader or ApplyOptions.
(Read only property)

PNGReaderMBS.Height as Integer

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

(Read and Write property)

PNGReaderMBS.InterlaceType as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property PNG MBS Images Plugin 9.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The interlace setting.

(Read and Write property)

PNGReaderMBS.Interlacing as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property PNG MBS Images Plugin 9.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether the png file is interlaced.

Value is 1 if not interlaced and 7 if interlaced.
(Read and Write property)

Some examples using this property:

PNGReaderMBS.InvertAlpha as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property PNG MBS Images Plugin 19.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether alpha values should be inverted.

Set before ApplyOptions if you need this option.
Default is false.

see png_set_invert_alpha function in libpng documentation.
(Read and Write property)

Some examples using this property:

PNGReaderMBS.Mask as Picture

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

(Read and Write property)

PNGReaderMBS.OriginalColorType as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property PNG MBS Images Plugin 19.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The original color type of the PNG file.

The value is a combination of this constants:
PNG_COLOR_MASK_PALETTE= 1
PNG_COLOR_MASK_COLOR= 2
PNG_COLOR_MASK_ALPHA= 4

The PNG library will convert on reading every row into 32bit RGBA, so don't worry about this.

The OriginalColorType property is the color type of the file. ColorType property reports what ApplyOptions changed it to, so you know what ReadRow will put in the MemoryBlock.
(Read and Write property)

Some examples using this property:

PNGReaderMBS.Pict as Picture

Type Topic Plugin Version macOS Windows Linux iOS Targets
property PNG MBS Images Plugin 9.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The picture read.

(Read and Write property)

PNGReaderMBS.RGBToGray as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property PNG MBS Images Plugin 19.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether to convert RGB to grayscale.
Example
dim png as PNGReaderMBS

// ask for gray only
png.RGBToGray = True

// avoid extra filler bytes for missing alpha channel
png.UseFiller = false

Set before ApplyOptions if you need this option.
Default is false.

see png_set_rgb_to_gray function in libpng documentation.
(Read and Write property)

PNGReaderMBS.RGBToGrayErrorAction as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property PNG MBS Images Plugin 19.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Error handling option for Reduce RGB to grayscale.

Can be 1 for none, 2 for warn or 3 for error.
Default is 1.
(Read and Write property)

PNGReaderMBS.RGBToGrayGreen as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property PNG MBS Images Plugin 19.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The green coefficient to use for RGB to Gray conversion.

Default is -1 for default coefficients.
(Read and Write property)

PNGReaderMBS.RGBToGrayRed as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property PNG MBS Images Plugin 19.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The green coefficient to use for RGB to Gray conversion.

Default is -1 for default coefficients.
(Read and Write property)

PNGReaderMBS.SourceData as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property PNG MBS Images Plugin 10.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The source data used in Open functions.
Example
dim p as PNGReaderMBS // your reader

// write data to file
dim fo as FolderItem = SpecialFolder.Desktop.Child("mbsout.png")
dim bo as BinaryStream = fo.CreateBinaryFile("") // BinaryStream.Create(fo,true) in newer RB Versions

bo.Write p.SourceData

If you used OpenSpecialData, the data here is the PNG without the Apple modifications, but still with swapped colors.
This property is set by the OpenSpecialData, Open and OpenData functions.
(Read and Write property)

Some examples using this property:

PNGReaderMBS.SourceFile as FolderItem

Type Topic Plugin Version macOS Windows Linux iOS Targets
property PNG MBS Images Plugin 10.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The folderitem passed to the Open functions.

This property is set by the Open and OpenFile functions.
(Read and Write property)

PNGReaderMBS.SourcePath as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property PNG MBS Images Plugin 19.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The source file path.

(Read and Write property)

PNGReaderMBS.StripAlpha as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property PNG MBS Images Plugin 19.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether to strip alpha.

Set before ApplyOptions if you need this option.
Default is false.

see png_set_strip_alpha function in libpng documentation.
(Read and Write property)

PNGReaderMBS.SwapRB as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property PNG MBS Images Plugin 10.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether to swap red and blue channels.
Example
dim p as new PNGReaderMBS
p.SwapRB = true

The PNG files for the iPhone have swapped channels so the iPhone does not need to swap them for display. One of the tricks Apple uses for making the iPhone faster.
This flag is set to true by OpenSpecialData.
(Read and Write property)

PNGReaderMBS.UseFiller as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property PNG MBS Images Plugin 19.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether filler byte is used for RGB.

Set by ApplyOptions if needed.
Defines whether RGB is extended to 4 bytes with an extra filler byte if needed.

see png_set_filler function in libpng documentation.
(Read and Write property)

Some examples using this property:

PNGReaderMBS.UserHeightMaximum as UInt32

Type Topic Plugin Version macOS Windows Linux iOS Targets
property PNG MBS Images Plugin 20.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The height maximum.

The PNG specification allows the width and height of an image to be as large as 2^31-1 (0x7fffffff), or about 2.147 billion rows and columns.
For safety, libpng imposes a default limit of 1 million rows and columns.
Larger images will be rejected immediately with a png_error() call. If you wish to change these limits, you can use this property to set your own limits (libpng may reject some very wide images anyway because of potential buffer overflow conditions).
(Read and Write property)

PNGReaderMBS.UserWidthMaximum as UInt32

Type Topic Plugin Version macOS Windows Linux iOS Targets
property PNG MBS Images Plugin 20.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The width maximum.

The PNG specification allows the width and height of an image to be as large as 2^31-1 (0x7fffffff), or about 2.147 billion rows and columns.
For safety, libpng imposes a default limit of 1 million rows and columns.
Larger images will be rejected immediately with a png_error() call. If you wish to change these limits, you can use this property to set your own limits (libpng may reject some very wide images anyway because of potential buffer overflow conditions).
(Read and Write property)

PNGReaderMBS.Width as Integer

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

(Read and Write property)

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


The biggest plugin in space...