different-ai/openwork · warning · Error

Use an image no larger than 4096×4096 pixels.

Error message

Use an image no larger than 4096×4096 pixels.

What it means

After decoding, createBrandAssetDraft enforces a maximum dimension of 4096×4096 pixels on all brand assets (icons and wordmarks alike). Extremely large images are rejected to bound memory use when rendering and re-encoding the asset.

Source

Thrown at ee/apps/den-web/app/(den)/dashboard/_components/brand-appearance-screen.tsx:44

  previewUrl: string;
  width: number;
  height: number;
};

async function createBrandAssetDraft(file: File, kind: BrandAssetKind): Promise<BrandAssetDraft> {
  if (file.type !== "image/png" && file.type !== "image/jpeg") throw new Error("Use a PNG or JPEG image.");
  if (file.size > BRAND_ASSET_MAX_BYTES) throw new Error("Use an image under 2 MB.");

  let image: ImageBitmap;
  try {
    image = await createImageBitmap(file);
  } catch {
    throw new Error("OpenWork could not decode that image.");
  }

  const { width, height } = image;
  image.close();
  if (width > 4096 || height > 4096) throw new Error("Use an image no larger than 4096×4096 pixels.");
  if (kind === "icon") {
    if (width < 64 || height < 64) throw new Error("Use a square icon at least 64×64 pixels.");
    if (width !== height) throw new Error("Use a square image for the app icon.");
  } else {
    const aspectRatio = width / height;
    if (width < 128 || height < 32) throw new Error("Use a wordmark at least 128×32 pixels.");
    if (aspectRatio < 1.5 || aspectRatio > 8) throw new Error("Use a horizontal wordmark between 1.5:1 and 8:1.");
  }

  return { file, previewUrl: URL.createObjectURL(file), width, height };
}

function BrandAssetUploadField({
  kind,
  title,
  description,
  currentUrl,
  managedAsset,

View on GitHub (pinned to 2b7df46e8a)

Solutions

  1. Downscale the image to at most 4096×4096 (and at least the kind's minimum) before uploading.
  2. Export at 1x from the design tool instead of 2x/3x.
  3. Use squoosh/ImageMagick (magick input.png -resize 4096x4096 output.png) to resize.
  4. Check dimensions client-side before calling the draft creator so you can auto-resize instead of erroring.

Example fix

// before
await draft(oversizedFile, "wordmark"); // throws at 6000x4000
// after
const resized = await resizeImage(oversizedFile, { maxWidth: 4096, maxHeight: 4096 });
await draft(resized, "wordmark");
Defensive patterns

Strategy: validation

Validate before calling

async function isWithinMaxSize(file: File): Promise<boolean> {
  const bmp = await createImageBitmap(file);
  const ok = bmp.width <= 4096 && bmp.height <= 4096;
  bmp.close();
  return ok;
}

Try / catch

try {
  const asset = await createBrandAssetDraft(file, kind);
} catch (error) {
  showToast(error instanceof Error ? error.message : "Could not use that image.");
}

Prevention

When it happens

Trigger: Uploading a decoded image where width > 4096 or height > 4096 — e.g. a 6000×4000 DSLR photo as a wordmark, or a 8192×8192 print-resolution logo export.

Common situations: Print-design exports at 300 DPI; screenshots of 5K displays; AI-upscaled logos; photographers supplying original photos for branding.

Related errors


AI-assisted analysis of different-ai/openwork@2b7df46e8a (2026-09-01). Data as JSON: /api/errors/8f18d773015694dc. Report an issue: GitHub.