quasarframework/quasar · warning

Correction on padding for ${file.relativeName} due to paddin

Error message

Correction on padding for ${file.relativeName} due to padding exceeding file's dimension of ${size}x${size}px

What it means

getSquareIcon pads a source image to make it square before resizing. If the requested padding would exceed the image's dimensions of size x size px, the padding is corrected (width/height clamped, offset zeroed) and a warning is emitted listing which dimensions were corrected.

Source

Thrown at icongenie/lib/utils/get-square-icon.js:28

  const img = icon.clone()
  let width = size - 2 * horiz
  let height = size - 2 * vert
  const corrections = []

  if (width <= 0) {
    width = size
    horiz = 0
    corrections.push('width')
  }

  if (height <= 0) {
    height = size
    vert = 0
    corrections.push('height')
  }

  if (corrections.length !== 0) {
    warn(
      `Correction on padding for ${file.relativeName} due to padding exceeding file's dimension of ${size}x${size}px`
    )
  }

  img.resize({
    width,
    height,
    fit: 'contain',
    background
  })

  if (horiz > 0 || vert > 0) {
    img.extend({
      top: vert,
      bottom: vert,
      left: horiz,
      right: horiz,
      background

View on GitHub (pinned to 4841521b5f)

Solutions

  1. Reduce the padding value so padding stays within the source image dimensions
  2. Provide a larger source icon (1024x1024 or bigger is recommended) matching the profile's declared dimensions
  3. If the correction is acceptable, ignore the warning — icongenie clamps the padding automatically

Example fix

// before (256px source)
icongenie g --icon icon.png --padding 96
// after
icongenie g --icon icon-1024.png --padding 16
Defensive patterns

Strategy: validation

Validate before calling

import { imageSize } from 'image-size'
const dim = imageSize(sourceIconPath)
const padding = Number(profile.padding || 0)
if (padding * 2 >= Math.min(dim.width, dim.height)) {
  throw new Error(`Padding ${padding}px too large for ${dim.width}x${dim.height}px icon`)
}

Prevention

When it happens

Trigger: Running icongenie with padding larger than the source image's dimensions, e.g. `icongenie g --padding 100` on an icon that is smaller than the target size, or a non-square image whose shorter side is exceeded by padding.

Common situations: Using a small source icon (e.g. 256px) with a large padding option, or padding values copied from a profile generated for larger source images.

Related errors


AI-assisted analysis of quasarframework/quasar@4841521b5f (2026-08-30). Data as JSON: /api/errors/cf435f1db678b04f. Report an issue: GitHub.