#Next.js#Open Graph#Social SEO#TypeScript#Debugging

Why Your Open Graph Image Crops on LinkedIn & Discord (And How to Fix It in Next.js)

Resolve social preview image clipping, 1.91:1 vs 1:1 aspect ratio mismatches, CORS edge canvas timeouts, and configure dynamic Next.js App Router metadata.

O
OmniSEO Engineering
Technical SEO & Core Infrastructure
Sep 21, 2026
6 min read

When shipping a web application or content hub, few things are as frustrating as deploying a custom-designed social share banner only to see it awkwardly cropped on LinkedIn, stretched on Twitter/X, or condensed into a distorted thumbnail square on Discord.

Social platforms do not parse your <meta property="og:image"> tags identically. While Facebook, Twitter, and LinkedIn share the standard 1.91:1 landscape aspect ratio (1200 × 630 pixels), other platforms like Discord, WhatsApp, and iMessage apply dynamic heuristics based on image dimensions, file size budgets, and cached user-agent scraping rules.

In this deep-dive guide, we will uncover the exact root causes of social image cropping, establish a universal "Safe Zone" canvas template, and implement dynamic, automated @vercel/og image generation in the Next.js App Router.

Updated

Test Your Live URL in the Sandbox

Inspect multi-platform crawlers and see real-time render simulations across Twitter, LinkedIn, Facebook, and Discord.


Section 1: The Multi-Platform Aspect Ratio Trap

Every crawler relies on its own rendering engine to display link cards in user feeds. Here is the canonical breakdown of how major platforms parse Open Graph images:

| Platform | Card Mode | Render Dimensions | Expected Ratio | Fallback Behavior | | :--- | :--- | :--- | :--- | :--- | | LinkedIn | Native Feed Banner | 1200 × 627 px | 1.91:1 | Centers & crops 24px top/bottom margins | | Twitter / X | summary_large_image | 1200 × 630 px | 1.91:1 / 16:9 | Crops horizontal edges; defaults to summary if < 300px | | Facebook | Large Preview Card | 1200 × 630 px | 1.91:1 | Center crops; minimum requirement is 200 × 200 px | | Discord | Embed Card Banner | 1200 × 630 px | 1.91:1 | Flips to square thumbnail if ratio is < 1.5:1 | | Slack | Inline Unfurl Card | 1200 × 630 px | 1.91:1 | Displays inline expandable card preview |

The Universal Safe Zone Rule

LinkedIn's crawler enforces an internal viewport of 1200 × 627 pixels, while Twitter and Facebook expect 1200 × 630 pixels. When you upload a standard 16:9 graphic (1920 × 1080 or 1200 × 675), LinkedIn calculates a vertical offset and slices 24 pixels directly off the top and bottom.

To guarantee 100% visibility across all social scrapers, always design on a 1200 × 630 canvas and confine all critical typography, logos, and UI elements to the inner safe content area (960 × 504 pixels for ultra-safe cross-platform delivery, inside the 1080 × 510 pixel 10% buffer zone).

Open Graph 1200 × 630 Canvas & Safe Zone Architecture
1.91:1 Aspect Ratio1200 × 630 px
Top 60px Buffer Margin
CRITICAL CONTENT SAFE ZONE (1080 × 510 px)

Keep All Headlines, Brand Logos, Badges & High-Value Visuals Here

Bottom 60px Buffer Margin
LinkedIn: 1200x627 Safe
Twitter/X: Large Card 1.91:1
Facebook: 1200x630 Full
Discord: >1.5:1 Banner

The 10% Safe Margin Formula: Always generate Open Graph images at 1200 × 630 pixels, and preserve 60px buffer margins on the top and bottom boundaries so your 960 × 504 core message area is never clipped.


Section 2: Dynamic Next.js App Router Setup

In the Next.js App Router, you can export a type-safe generateMetadata function that provides explicit image dimensions to search engine scrapers:

TYPESCRIPT
import type { Metadata } from "next";

interface Props {
  params: Promise<{ slug: string }>;
}

export async function generateMetadata({ params }: Props): Promise<Metadata> {
  const { slug } = await params;
  const canonicalUrl = `https://omniseotools.com/blog/${slug}`;
  const ogImageUrl = `https://omniseotools.com/blog/${slug}/opengraph-image`;

  return {
    title: "Why Your Open Graph Image Crops on LinkedIn & Discord | OmniSEO",
    description: "Resolve social preview image clipping, 1.91:1 vs 1:1 aspect ratio mismatches, and configure dynamic Next.js App Router metadata.",
    alternates: {
      canonical: canonicalUrl,
    },
    openGraph: {
      title: "Why Your Open Graph Image Crops on LinkedIn & Discord",
      description: "Fix common social media preview image bugs with 1.91:1 safe zone guidelines.",
      url: canonicalUrl,
      siteName: "OmniSEO Tools",
      images: [
        {
          url: ogImageUrl,
          width: 1200,
          height: 630,
          alt: "Open Graph Safe Zone Guide",
          type: "image/png",
        },
      ],
      type: "article",
    },
    twitter: {
      card: "summary_large_image",
      title: "Why Your Open Graph Image Crops on LinkedIn & Discord",
      description: "Master the 1.91:1 aspect ratio and Next.js App Router dynamic metadata.",
      images: [ogImageUrl],
    },
  };
}

Section 3: The Silent Culprit: Missing Image Content-Type Headers

Many social crawlers (notably LinkedIn and Discord bot user-agents) will drop your image preview entirely if the remote server fails to return explicit binary MIME headers or takes longer than 3 seconds to respond.

Here is an enterprise-grade Edge route handler using @vercel/og that sets explicit image/png content-types and aggressive caching:

TYPESCRIPT
import { ImageResponse } from "next/og";

export const runtime = "edge";
export const alt = "Technical Article Preview";
export const size = { width: 1200, height: 630 };
export const contentType = "image/png";

export default async function Image({ params }: { params: Promise<{ slug: string }> }) {
  const { slug } = await params;

  return new ImageResponse(
    (
      <div
        style={{
          height: "100%",
          width: "100%",
          display: "flex",
          flexDirection: "column",
          justifyContent: "space-between",
          backgroundColor: "#020617",
          backgroundImage: "linear-gradient(135deg, #020617 0%, #0B0F19 50%, #111827 100%)",
          padding: "60px 70px",
          fontFamily: "system-ui, sans-serif",
        }}
      >
        {/* Top Header Badge */}
        <div style={{ display: "flex", alignItems: "center", gap: 12 }}>
          <div
            style={{
              backgroundColor: "#10b981",
              color: "#ffffff",
              padding: "6px 16px",
              borderRadius: 9999,
              fontSize: 16,
              fontWeight: 700,
              textTransform: "uppercase",
            }}
          >
            Engineering Guide
          </div>
          <span style={{ color: "#94a3b8", fontSize: 18 }}>
            omniseotools.com/blog
          </span>
        </div>

        {/* Central Safe-Zone Headline */}
        <div style={{ display: "flex", flexDirection: "column", gap: 16 }}>
          <h1
            style={{
              fontSize: 52,
              fontWeight: 900,
              color: "#ffffff",
              lineHeight: 1.15,
              margin: 0,
            }}
          >
            Why Your Open Graph Image Crops on Social Media
          </h1>
          <p style={{ fontSize: 22, color: "#94a3b8", margin: 0 }}>
            Master the 1.91:1 aspect ratio, safe margin padding, and Next.js App Router dynamic metadata.
          </p>
        </div>

        {/* Footer Attribution */}
        <div
          style={{
            display: "flex",
            alignItems: "center",
            justifyContent: "space-between",
            borderTop: "1px solid #1e293b",
            paddingTop: 24,
          }}
        >
          <span style={{ color: "#10b981", fontWeight: 700, fontSize: 20 }}>
            OmniSEO Tools
          </span>
          <span style={{ color: "#64748b", fontSize: 16 }}>
            100% Free Developer Utilities
          </span>
        </div>
      </div>
    ),
    {
      ...size,
      headers: {
        "content-type": "image/png",
        "cache-control": "public, max-age=31536000, immutable",
      },
    }
  );
}

Section 4: Lateral Tool Bridges

Accelerate your social workflow with zero-latency browser utilities:

Popular

Validate Twitter & Large Card Formats

Inspect raw response headers and ensure summary_large_image matches pixel bounds.

Popular

Tag Your Social Distribution Links

Track referral traffic from Discord, LinkedIn, and Twitter directly in GA4 with clean parameters.


Section 5: Frequently Asked Technical Questions

Featured Interactive Tool

Launch Open Graph Meta Tag Generator

Generate production-ready Open Graph, Twitter Card, and standard SEO meta tags for HTML5, Next.js App Router, and React Helmet.

O
Written by OmniSEO Engineering
Technical SEO & Core Infrastructure • OmniSEO Tools Core Engineering