Extra parameter for image/vnd.star.png

Vendor original media types may also have custom parameters. At this time, only “image/vnd.star.png” does.
Clients which impose limitations on the image/PNG format beyond what is likely to be expected by server developers, should additionally implement the image/vnd.star.png media type.
This is fully compatible with the standard PNG file format, but can be used to inform the server of limitations, such as accepted bit depth and size.
Commonly, this may be necessary because of RAM limitations in the target device, and the relatively large size of a 24/32bit per pixel bitmap when it is fully uncompressed, which is necessary for printing.
Media type parameters are provided by the client, when informing the server of the supported media types by the GET query string when requesting a job.
Servers which recognize this media type, can also specify these dimensions within their POST response when a job is available, in order to let the client decide if it is able to handle the job or not.
For example, the printer may request image/vnd.star.png for print jobs up to 300mm, but fall back to text/plain if the job exceeds this.

From CloudPRNT Client to Server

When a client provides the response when it makes a GET request for a print job using the image/vnd.star.png media type, then it should also supply the following query parameters.

Parameter

Description

mono_len=<length>

Inform the server of the maximum pixel height of monochrome (1 bit per pixel) PNG image that can be supported by the client.
NOTE: this length is based on memory limitation, and assumes that the image width matchers the printer dot width.

24bpp_len=<length>

Inform the server of the maximum pixel height of 24bit color PNG image that can be supported by the client.
NOTE: this length is based on memory limitation, and assumes that the image width matchers the printer dot width.

Example (based on mC-Print)

[http/https]://[cloudprntURL]?uid=<printer ID>&type=image/vnd.star.png;mono_len=<length>;24bpp_len=<length>&mac=<mac address>

From Server to Client (POST response)

hen a server replies to a POST, with the jobReady=true field, it must also provide a list of media types in which the job can be provided, using the mediaTypes field.
In this case, the following parameters can be included with the image/vnd.star.png media type to describe the actual job size, and formats that can be provided.

Parameter

Description

mono_len=<length>

Inform the client that the job can be provided as a monochrome (1 bit per pixel) PNG, and is <length> pixels in height.

24bpp_len=<length>

Inform the client that the job can be provides as a 24bit color PNG and is <length> pixels in height.

A server can provide one or both parameters, to indicate that it can provide mono, 24bit or both formats. If at least one is compatible, then the CloudPRNT client may request it (depending on media type preference order).
Example POST response from server, which can provide the job as text or monochrome png image that is 800 dots(10cm) tall:
{
    "jobReady": true,
    "mediaTypes": [ "image/vnd.star.png;mono_len=800", "image/png", "text/plain" ]
}
in the above case, an mC-Print3 printer, would recognize that the job is available as a PNG that is within it’s supported constraints, and so would then provide a GET request to fetch the job, with a query parameter such as:
?type=image/vnd.star.png;mono_len=2400;24bpp_len=400&mac=00:00:00:00:00:00
When the server responds to this request, it may specify the response mime type as either image/vnd.star.png or image/png since the PNG specific dimensions will be decoded from the file header anyway, and the data should provide a fully compliant PNG image file.