Skip to content

PNG Destination ​

The PNG destination downloads screenshot images referenced by screenshot.url.received events and stores them on disk.

Unlike the metadata destinations, PNG screenshots are configured under Butler-SOS.auditEvents.destination.screenshots rather than through auditEvents.destination.type.

How It Is Enabled ​

Enable screenshot downloads with Butler-SOS.auditEvents.destination.screenshots.enable=true and configure at least the storage targets and allowed download hosts.

yaml
Butler-SOS:
  auditEvents:
    destination:
      screenshots:
        enable: true
        allowedImageDownloadHosts:
          - qliksense.company.com

What It Stores ​

The PNG destination stores screenshot image files downloaded from the screenshot URLs carried by audit events.

These files can be correlated with:

  • the original audit event via eventId
  • JSON object-data files via the shared file-naming model
  • metadata rows written to InfluxDB, Parquet, or QVD

Authentication And Security ​

Screenshot downloads support the following authentication modes:

  • none
  • qpsTicket
  • userTicket

Downloads are also protected by allowedImageDownloadHosts, which constrains which hostnames Butler SOS may contact when retrieving screenshots.

Trimming screenshots ​

When the Audit.qs browser extension reports a screenshot of a Qlik Sense chart or table, it usually sends some extra information along with the screenshot link: the size of the object as the user saw it on screen, and how far the user had scrolled inside it. Butler SOS calls this the crop information. It uses it to trim the image it downloads from Qlik Sense so that the stored screenshot shows exactly what the user saw, no more and no less.

Colour-coded table rows ​

Changed in 15.1.0

Before Butler SOS 15.1.0, the partial bottom row was left in screenshots of colour-coded tables.

What changed ​

When Butler SOS stores a screenshot of a Qlik Sense sheet, it trims away the partially-visible bottom row that the rendering service sometimes includes — the sliver of a row that the user could not actually see on screen. To find where to cut, Butler SOS looks for the horizontal grid line beneath the last fully-visible row.

That search used to examine only the red component of each pixel. On tables where the row above the grid line is colour-coded — heat maps, conditional background colours, alternating themed fills — the colours can differ from one another while sharing the same amount of red. Butler SOS read those rows as blank, concluded it had not found a real grid line, and stored the screenshot untrimmed.

The search now compares all three colour components. Grid lines beneath colour-coded rows are found correctly, and the partial row is trimmed as intended.

What you will notice ​

Screenshots of sheets containing colour-coded tables may be slightly shorter than before, because the partial bottom row is now removed. This affects the stored image only — nothing changes about which events are captured, where files are written, or how they are named.

Screenshots of sheets without colour-coded tables are unchanged.

Do I need to do anything? ​

No. There is no new or changed configuration setting, and no action is required when upgrading.

If you keep screenshots from before and after the upgrade side by side, expect the newer ones to be a few pixels shorter for the affected sheets. That is the fix working, not a fault.

If a screenshot looks wrong ​

Trimming is driven by information the Butler SOS browser extension sends alongside each event. If a stored screenshot appears to be missing a row it should have kept, or is still including a row it should have trimmed, enable debug logging for Butler SOS and reproduce the event.

Debug logging writes intermediate copies of the image to an audit-events/debug folder beneath the working directory, which show what the trimming step actually did. Note that debug logging makes screenshot processing noticeably slower, so turn it on only while investigating and off again afterwards.

Checking the crop information ​

Changed in 15.1.0

Butler SOS 15.0.1 and earlier accepted whatever crop information the extension sent.

Butler SOS checks the crop information before accepting a screenshot event. This section explains what is checked, what is accepted, and how to recognise an event that was refused.

Why the check exists ​

The crop information arrives from the user's web browser, so Butler SOS cannot simply trust it. Absurd values — negative sizes, or a size of billions of pixels — never come from a real screenshot, but they could be sent deliberately to make Butler SOS waste time and memory processing an image. The check stops such values before any image work is done.

What is accepted ​

Every kind of crop information a real Audit.qs installation sends is accepted. This section covers the crop information only: an event can still be refused for other reasons, and the Payload validation failed log line names the field that caused it.

  • Crop information sent as null ("crop": null). Audit.qs sends this when the screenshot was taken by one of its fallback methods rather than its normal one. When that fallback produced a screenshot link, the screenshot is stored untrimmed.
  • Fractional values, such as a scroll position of 1234.5 pixels. Browsers that are zoomed to something other than 100%, and screens with fractional scaling, report scroll positions like this. Butler SOS rounds them down to whole pixels before trimming.
  • Very large scroll positions. A Qlik Sense table (the newer type, not the legacy one) scrolls through all of its rows at once, so a table with tens of thousands of rows can report a scroll position of more than a million pixels: about 1.8 million for a table of 72,000 rows, scrolled to the bottom. These are accepted. Audit.qs asks Qlik Sense for an image taller by the scroll position, so a deep scroll usually produces a screenshot too large for Butler SOS to unpack. It is then stored as downloaded, without trimming; see The size limit.
  • No crop field at all. Audit.qs always includes the field, but other clients posting to the audit API may leave it out. The screenshot is then stored untrimmed, as with null.

What is refused ​

A screenshot event is refused when its crop information contains any of the following:

ProblemExample
A negative size, position or scroll value"top": -1
A width or height of zero"width": 0
A size or position larger than 32,767 pixels, the largest image a browser can draw"height": 40000
A scroll position larger than 33,554,432 pixels, the largest page a browser can lay out"scrollTop": 50000000
A value that is not a number"width": "800"
No width, or no height{ "top": 0, "left": 0 }
An empty set of values, which has no width or height"crop": {}
Crop information that is neither a set of values nor null"crop": "full"

Audit.qs does not send any of these when it is working normally.

What happens to a refused event ​

The whole event is dropped, not just the crop information. Nothing is written to any audit destination for it (JSON, Parquet, QVD or InfluxDB), and no screenshot is downloaded.

The sender receives HTTP status 422 with a response body like this:

json
{
    "status": "error",
    "receivedAt": "2026-10-06T09:15:02.118Z",
    "outcome": "dropped",
    "reason": "Payload validation failed",
    "details": {
        "errors": [
            {
                "instancePath": "/event/crop/top",
                "schemaPath": "#/properties/event/properties/crop/properties/top/minimum",
                "keyword": "minimum",
                "params": { "comparison": ">=", "limit": 0 },
                "message": "must be >= 0"
            }
        ]
    }
}

Butler SOS also writes a warning to its log. The instancePath names the offending value:

text
AUDIT API: Payload validation failed type=screenshot.url.received eventId=... errors=[{"instancePath":"/event/crop/top", ... "message":"must be >= 0"}]

Do I need to do anything? ​

No. There is no new or changed configuration setting, and no action is needed when upgrading.

If you see Payload validation failed warnings that mention /event/crop, note the event IDs and check which client is posting to the Butler SOS audit API. An unmodified Audit.qs extension is not expected to send crop information that fails these checks, so a steady stream of such warnings is worth investigating, and reporting if Audit.qs turns out to be the sender.

The size limit ​

Changed in 15.1.0

Butler SOS 15.0.1 and earlier unpacked every screenshot whatever its size.

When Butler SOS downloads a screenshot for an audit event, it may trim the image to what the user saw on screen, and it may write a copy with a metadata header (the _metadata file). Both mean unpacking the image in memory. Butler SOS checks a screenshot before unpacking it, and leaves very large images as they are.

Why there is a limit ​

Unpacking a screenshot happens all at once, and Butler SOS does nothing else while it runs. It also needs far more memory than the file takes on disk: a mostly white table image of a few hundred kilobytes can unpack to gigabytes. Earlier versions unpacked every screenshot whatever its size, so a single very large one could stall Butler SOS for seconds or exhaust its memory.

How large is too large ​

Butler SOS unpacks screenshots of up to 20 million pixels. An image stored with 16 bits per colour channel, rather than the usual 8, counts double, because unpacking it takes twice the memory. For comparison:

ImagePixels
Full HD (1920 x 1080)2.1 million
A whole 4K screen8.3 million
A whole 5K screen14.7 million

Screenshots of ordinary sheets and objects are far below the limit. At the limit, unpacking takes about 0.2 seconds and roughly 320 MB of extra memory; writing the _metadata copy as well takes about 0.8 seconds and roughly 470 MB. A 16-bit image at the limit (10 million pixels, counted as 20 million) takes about the same memory but about 0.5 seconds. These figures were measured on Node.js 24.

Some files are never unpacked, whatever their size, because they are not normal screenshots and unpacking them could use unbounded memory: images with a width or height of zero, images with more than one header, images whose header describes a format PNG does not allow, images with more than one colour palette or a palette of more than 256 colours, and images split into more than 100,000 pieces (chunks). Real screenshots use a few thousand at most. Interlaced images are unpacked only after Butler SOS has checked that their data does not unpack to more than their header says.

What happens to a screenshot over the limit ​

  • The screenshot is stored exactly as downloaded, without trimming.
  • The separate _metadata copy is not written.
  • The audit event itself is stored as normal, in every destination.

Butler SOS checks a screenshot only when it has to unpack it: to trim it, to write the _metadata copy, or because it is logging at debug level. A screenshot that needs none of these is stored as downloaded without being unpacked, and nothing is logged, whatever its size.

When an unpack is refused, Butler SOS logs one warning naming the reason. When the screenshot needed trimming, or Butler SOS is logging at debug level, it looks like this (the words "and without its _metadata copy" appear only when the metadata header is switched on):

text
AUDIT API: Screenshot stored as downloaded, untrimmed and without its _metadata copy: image is 800x1800354 (1440283200 pixels), above the decode budget of 20000000 pixels; not decoded. selectionTxnId=... eventId=...

When the screenshot needed no trimming but the metadata header is switched on, the warning reads instead:

text
AUDIT API: Screenshot _metadata copy not written: image is 800x1800354 (1440283200 pixels), above the decode budget of 20000000 pixels; not decoded. selectionTxnId=... eventId=...

The same _metadata copy not written warning appears for a screenshot within the limit whose metadata copy would exceed it, because a long header line makes a narrow image much wider: output would be 1012x199106 (201495272 pixels), above the decode budget of 20000000 pixels; not built.

The files that are never unpacked give one of these reasons instead of the size: PNG header gives 0x..., PNG has a second IHDR chunk, PNG colour type ... with bit depth ... is not a valid combination, interlaced PNG data unpacks to more than its ... header allows, PNG has more than one palette chunk, PNG palette chunk is ... bytes, PNG has more than 100000 chunks, not a PNG or PNG header chunk has the wrong length.

None of these is an error. A warning that starts AUDIT API: Failed to crop screenshot PNG or AUDIT API: Failed to add metadata header to screenshot PNG is different: it means the image could not be processed at all, for example because the file is damaged.

Do I need to do anything? ​

No. There is no new or changed configuration setting.

A warning like this usually means Qlik Sense was asked for an image much taller than the screen, for example of a table scrolled far down. The audit event is complete; only its screenshot is untrimmed. If the warnings name images you would expect to be small, note the event IDs and check which client sent them.

Debug images ​

Changed in 15.1.0

Before Butler SOS 15.1.0, screenshot debug images were written at every log level, including the default.

Butler SOS writes screenshot debug images to disk only when the log level is set to debug or silly.

If you have an audit-events/debug folder that has been quietly filling with PNG files, this is why it has stopped growing. Nothing is broken, and no configuration change is needed.

What was happening before ​

When Butler SOS downloads a screenshot for an audit event, it sometimes has to trim the image. The Qlik Sense Printing Service renders whole rows of a table, so a table that is partly scrolled out of view — a pivot table, for example — comes back taller than what the user actually saw on screen. Butler SOS crops it to match.

While doing that trimming, Butler SOS also produced diagnostic output intended for troubleshooting that process:

  • PNG files written to audit-events/debug, inside the Butler SOS working directory. One file per cropped screenshot, sometimes three, named after the image dimensions.
  • Log entries at info level describing the internal trim geometry.
  • A full scan of every pixel in the image, done solely to produce one number that appears in one diagnostic log line.

All three were meant to happen only while diagnosing a problem. Because of a faulty check they happened all the time, on every cropped screenshot, no matter how the log level was set.

For a busy Qlik Sense environment this meant three things worth knowing about:

  • Disk consumption grew unbounded. Nothing ever removed those files.
  • Every screenshot cost more CPU than it needed to, because of the full-image pixel scan whose only output was a log line nobody would see at the default log level.
  • Log lines described internal image geometry at info level, which is not information an operator has any use for during normal running.

What happens now ​

All of it is tied to the log level:

Log levelDebug images writtenTrim geometry logged
error, warn, info, verboseNoNo
debug, sillyYesYes, at debug level

Screenshot capture, trimming and storage are completely unchanged. The images Butler SOS stores in your configured screenshot locations are exactly the same as before. Only the extra diagnostic copies are affected.

The diagnostic log entries have also moved from info to debug. If you have log searches or alerts matching phrases such as Scroll composite, Overflow composite or Saved pre-crop debug image, they will no longer match at the default log level. Those messages describe internal image geometry and were never intended as operational signals.

What you should do ​

In most cases, nothing. This is the behaviour you would have expected all along.

Clean up the old files. Any PNGs already written are still there. Look for an audit-events/debug folder inside the directory Butler SOS runs from, check how large it has grown, and delete the contents — nothing reads them. On a long-running installation handling many screenshots this can be a substantial amount of space.

If you were relying on those images for troubleshooting, set Butler-SOS.logLevel to debug and they will be written again exactly as before.

yaml
Butler-SOS:
    logLevel: debug # Only while investigating. Produces a lot of output.

Remember to set it back afterwards. debug is verbose across the whole of Butler SOS, not just screenshot handling, and turning it on also re-enables the unbounded growth of the debug image folder.

A note on where the files go ​

The debug image folder is always audit-events/debug, relative to the directory Butler SOS is started from. It does not follow your configured screenshot storage locations and is not configurable.

This matters most in Docker, where the working directory belongs to the container: unless it is on a mounted volume, the files disappear when the container is replaced — and if the container user cannot write there, Butler SOS carries on regardless without reporting a problem, since these images are diagnostic only.

  • Butler-SOS.logLevel — controls whether these diagnostics are produced at all. See Configuring Butler SOS Logging.
  • Butler-SOS.auditEvents.* — audit event and screenshot configuration, including where captured screenshots are stored.

Detailed Page ​

Use the detailed child page for authentication, redirect handling, session reuse, and troubleshooting of downloads:

Released under the MIT License.