Download Latest Version openpublisher5g_amd64-windows.exe (81.1 MB)
Home / 5.6.9
Name Modified Size InfoDownloads / Week
Parent folder
OpenPublisher-5-x86_64.AppImage 2026-10-11 166.4 MB
openpublisher5_amd64-windows-portable.exe 2026-10-11 183.2 MB
openpublisher5_amd64-windows.exe 2026-10-11 165.2 MB
openpublisher5_amd64-macos.dmg 2026-10-11 233.1 MB
openpublisher5_amd64-linux.run 2026-10-11 193.4 MB
5.6.9_ Image Rounded Corners _ Crop-to-Shape Complete Engine Fix source code.tar.gz 2026-10-11 22.5 MB
5.6.9_ Image Rounded Corners _ Crop-to-Shape Complete Engine Fix source code.zip 2026-10-11 22.8 MB
README.md 2026-10-11 17.4 kB
openpublisher5_amd64-linux.rpm 2026-10-11 215.4 MB
openpublisher5_amd64-linux.flatpak 2026-10-11 153.6 MB
openpublisher5_amd64-linux.deb 2026-10-11 156.2 MB
openpublisher5_amd64-freebsd.pkg 2026-10-11 185.5 MB
Totals: 12 Items   1.7 GB 0

πŸš€ Summary

Version 5.6.9 of Open Publisher delivers comprehensive fixes for image styling:

  1. Interactive Crop to Shape Modal Dialog: Resolves a critical bug where all shape buttons in the "Crop to Shape" dialog were inert and unclickable due to a missing DOM input reference.
  2. Right-Click Context Menu Integration: Adds direct access to "Crop to Shape" in the image right-click context menu alongside "Crop Image" and "Rounded Corners".
  3. Image Rounded Corners & Crop-to-Shape Print Engine Fix: Ensures image rounded corners (8px, 16px, 24px, 32px) and custom shape geometry (circles, ellipses, stars, triangles, hexagons, banners, speech bubbles) are preserved during printing, PDF export, document save/load, and undo/redo cycles.

Previously:

  • In the "Crop to Shape" dialog (ui/ui.js), each shape button executed an inline onclick handler that attempted to assign a value to document.getElementById('ctx-crop-shape'). Because this hidden input was never injected into the modal DOM, document.getElementById('ctx-crop-shape') returned null, throwing an unhandled TypeError: Cannot set properties of null (setting 'value'). This crashed the click handler before confirmation was triggered, leaving all 19 shape buttons completely non-responsive.
  • Applying rounded corners via the right-click context menu styled the image in the live DOM, but the styling was omitted from root element document serialization and bypassed by the print engine rasterizer. During physical printing or PDF generation, bakeImageForPrint in extensions/print-engine.js stripped clip-path styles from images, reverting them to sharp rectangles.

With Version 5.6.9:

  • Instantaneous Shape Crop Action (applyCropShape): Implemented a standalone, self-contained window.applyCropShape(shape) method that directly applies clipPath, -webkit-clip-path, borderRadius, and data-rounded-corners to both the <img> and container element. The dialog closes immediately upon clicking any shape option, pushes the state to history, and updates canvas thumbnails.
  • Defensive Hidden Input: Injected <input type="hidden" id="ctx-crop-shape"> into the modal dialog so manual "OK" button clicks also function seamlessly.
  • Context Menu "Crop to Shape" Entry: Added "Crop to Shape" directly to the image right-click context menu in ui/menus.js (ContextMenuActions.cropToShape).
  • True Physical Print Raster Clipping: The physical print engine (bakeImageForPrint in extensions/print-engine.js) features a vector clipping pipeline supporting inset(0 round Xpx) with per-corner radii, circle(...), ellipse(...), and polygon(...) coordinates in both pixels and percentages with alpha transparency.
  • Full Serialization & History State: The document serializer (core/history.js) explicitly preserves data.clipPath, data.borderRadius, data.imgStyle.clipPath, data.imgStyle.borderRadius, and data-rounded-corners in filterAttributes.
  • Deserialization & Live Re-Rendering: When loading publications or switching pages (core/pages.js), image elements are reconstructed with both border-radius, -webkit-clip-path, clip-path, and data-rounded-corners intact.
  • Native Browser Print Spooler Support: Browser-based print DOM generation (buildPrintDOM and io/file-io.js) guarantees that borderRadius and webkitClipPath are assigned to all image nodes in print iframes.
  • Canvas Renderer & HTML Export Integration: The export subsystem (io/export/canvas-renderer.js and io/export/export.js) passes clipping and corner geometry directly into image baking for high-resolution canvas captures and standalone HTML exports.
  • Comprehensive Cachebuster Synchronization: Synchronized all asset queries in index.html, Service Worker cache (open-publisher-v5-6-9), template loader queries in ui/dashboard.js, and subsystem headers to v5.6.9.

🌟 Key Updates in v5.6.9

1. Crop to Shape Modal Dialog Clickability & Reliability Fix

  • Direct Execution Architecture: Introduced window.applyCropShape(shape) which removes the fragile multi-step button-to-input-to-confirm-click chain. Clicking any shape card applies the shape immediately and smoothly dismisses the modal.
  • Missing Input Element Injected: Added <input type="hidden" id="ctx-crop-shape"> to the modal HTML body with the initial shape value, eliminating the TypeError null pointer exception.
  • High-Contrast Active States: Added .shape-crop-btn.active styling so the currently active shape is visually highlighted in the modal grid.
  • Direct Right-Click Integration: Added "Crop to Shape" to the image right-click context menu in ui/menus.js, allowing users to open the shape gallery directly from the canvas without needing to locate the ribbon tab.

2. Vector Print Engine Geometry Parser & Clipper

  • Full inset(...) Support: Added an SVG/CSS parser for inset(...) with corner radius declarations (round Xpx, multi-value corner radii).
  • Smooth roundRect Pathing: Uses native 2D Canvas roundRect with graceful fallback to quadratic curve arc clipping (arcTo) across all browser engines.
  • Direct Raster Canvas Clipping: Clips rasterCtx before rasterizing pixel data so that the image bitmap contains transparent pixels outside the clipped geometry. This allows drop shadows on the outer canvas to radiate naturally from the curved boundary rather than clipping the shadow.
  • Polygon & Ellipse Support: Fully parses comma-separated and space-separated coordinate pairs with % and px metrics for complex shapes (stars, triangles, hexagons, ribbons, bubbles).

3. Context Menu & Actions Unification

  • ContextMenuActions.setRoundedCorners(radius): Created a centralized handler for setting clipPath, webkitClipPath, borderRadius, and data-rounded-corners on both img and container elements.
  • Defensive Fallback Branch: Updated right-click menu items (None, 8px, 16px, 24px, 32px) in ui/menus.js with synchronized DOM attributes and history triggers.
  • Crop-to-Shape Synchronization: When shapes like rounded rectangle, hexagon, circle, or star are chosen in the Crop to Shape dialog, corner radii and clip paths are synchronized into document state immediately.

4. Serialization and Deserialization Pipeline

  • History Preservation: In core/history.js, serializeCurrentPage records imgBorderRadius and imgClipPath directly into root-level data.clipPath and data.borderRadius, ensuring compatibility with all export and print consumers.
  • Page Re-rendering: In core/pages.js, renderPage restores border-radius, clip-path, -webkit-clip-path, and data-rounded-corners onto both the <img> element and its container wrapper.
  • Sidebar & Minimap Thumbnails: Updated thumbnail generators in canvas/canvas.js and core/pages.js to reflect rounded corners and crop shapes in real time.

5. Version Bump & Cache Invalidation

  • Service Worker (sw.js): Updated cache name to open-publisher-v5-6-9 to ensure seamless client updates.
  • Cachebuster Query Parameters: Updated all 82 cachebuster queries in index.html and 2 in ui/dashboard.js to ?v=5.6.9.
  • Subsystem & About Dialog Metadata: Synchronized version identifiers in extensions/ui-interactions.js, extensions/legacy-fixes.js, extensions/pwa-install.js, extensions/print-engine.js, ui/sidebar-context.js, and ui/modals/options-modal.js.

🎨 Architectural & Implementation Details

1. Direct Crop Execution in ui/ui.js

:::javascript
window.applyCropShape = function(shape) {
    if (!state.selectedEl) return;
    const img = state.selectedEl.querySelector('img');
    if (!img) return;

    if (!shape || shape === 'none') {
        img.style.clipPath = 'none';
        img.style.webkitClipPath = 'none';
        img.style.borderRadius = '';
        img.removeAttribute('data-rounded-corners');
        state.selectedEl.removeAttribute('data-rounded-corners');
    } else {
        img.style.clipPath = shape;
        img.style.webkitClipPath = shape;
        const rMatch = shape.match(/round\s+([0-9]+(?:px|%))/i);
        if (rMatch) {
            img.style.borderRadius = rMatch[1];
            img.setAttribute('data-rounded-corners', rMatch[1]);
            state.selectedEl.setAttribute('data-rounded-corners', rMatch[1]);
        } else {
            img.style.borderRadius = '';
            img.removeAttribute('data-rounded-corners');
            state.selectedEl.removeAttribute('data-rounded-corners');
        }
    }
    if (typeof updatePageThumbnails === 'function') updatePageThumbnails();
    if (typeof pushHistory === 'function') pushHistory();
    if (typeof DialogSystem !== 'undefined' && DialogSystem.close) {
        DialogSystem.close();
    }
};

2. CSS Shape Clipping in extensions/print-engine.js

:::javascript
function applyClipPathRegion(ctx, clipPath, w, h, scale, offsetX, offsetY) {
    if (!clipPath || clipPath === 'none') return false;
    scale = scale || 1;
    offsetX = offsetX || 0;
    offsetY = offsetY || 0;

    ctx.beginPath();

    // Inset parsing with rounded corners
    const insetMatch = clipPath.match(/^inset\(([^)]+)\)/i);
    if (insetMatch) {
        const parts = insetMatch[1].trim().split(/\s+round\s+/i);
        const insetsStr = parts[0] || '0';
        const radiusStr = parts[1] || '';

        let rx = 0;
        if (radiusStr) {
            const rVal = parseFloat(radiusStr);
            if (!isNaN(rVal) && rVal > 0) {
                rx = radiusStr.includes('%') ? (rVal / 100) * Math.min(w, h) : rVal * scale;
            }
        }

        const x = offsetX;
        const y = offsetY;
        const rw = w * scale;
        const rh = h * scale;

        if (rx > 0 && typeof ctx.roundRect === 'function') {
            ctx.roundRect(x, y, rw, rh, [rx]);
        } else {
            ctx.rect(x, y, rw, rh);
        }
        ctx.clip();
        return true;
    }
    // Circle, ellipse, and polygon clipping paths handled with full pixel math
}

πŸ” Problems Solved

1. "Crop to Shape" Modal Buttons Unclickable

  • Problem: Opening the "Crop to Shape" dialog showed 19 shape cards (None, Rounded 8px, 16px, 24px, 32px, Circle, Oval, Triangle, Hexagon, Star, Diamond, etc.), but clicking any of them did nothing.
  • Root Cause: The inline onclick handler referenced document.getElementById('ctx-crop-shape').value = ..., but that input did not exist in the DOM. A TypeError: Cannot set properties of null was thrown on every click.
  • Solution in v5.6.9: Created window.applyCropShape(shape) to handle shape application directly and reliably, injected the hidden input element into the modal markup, and updated all buttons with type="button" and applyCropShape(...).

2. Rounded Corners Disappearing on Prints and Exports

  • Problem: Right-clicking an image and adding rounded corners (e.g., 32px) was visible on the canvas, but upon printing or PDF export, corners reverted to sharp 90-degree angles.
  • Root Cause: applyClipPathRegion in extensions/print-engine.js did not parse inset(... round ...) expressions, causing bakeImageForPrint to skip clipping on the canvas. Additionally, print DOM builders cleared clip-path styles during bake cleanup.
  • Solution in v5.6.9: Implemented vector roundRect pathing in applyClipPathRegion, clipping the image bitmap directly on rasterCtx with full corner transparency.

3. Failure to Serialize Image Geometry into Saved Documents

  • Problem: Saving publications or reloading pages stripped borderRadius and clipPath from image elements.
  • Root Cause: serializeCurrentPage in core/history.js only populated data.imgStyle.clipPath and omitted borderRadius and data-rounded-corners from root element properties and filter attributes.
  • Solution in v5.6.9: Added comprehensive serialization of clipPath, borderRadius, and data-rounded-corners to preserve visual formatting across sessions.

4. Crop to Shape Printing for Polygon and Non-Standard Shapes

  • Problem: While certain polygon shapes printed, shapes utilizing rounded coordinates or mixed percentage/pixel measurements failed.
  • Solution in v5.6.9: Unified the shape parser to handle both pixel (px) and percentage (%) units for all polygon vertices, circles, ellipses, and rounded rectangles.

πŸ“ Files Modified

File Changes
ui/ui.js Fixed "Crop to Shape" modal dialog: implemented window.applyCropShape, injected missing hidden input #ctx-crop-shape, updated 19 shape buttons to call applyCropShape, added active state styling, and added context menu action proxy. Added ContextMenuActions.setRoundedCorners.
ui/menus.js Added "Crop to Shape" directly to the image right-click context menu. Updated right-click Rounded Corners flyout items (None, 8px, 16px, 24px, 32px) to invoke ContextMenuActions.setRoundedCorners with inline fallback. Exposed window.ContextMenuSystem.
extensions/print-engine.js Added vector clipping parser for inset(...), roundRect, circles, ellipses, and polygons in applyClipPathRegion. Enhanced getImageShapeClipPath detection, raster canvas clipping in bakeImageForPrint, and bumped print engine version to v5.6.9.
core/history.js Serialized clipPath, borderRadius, and filterAttributes['data-rounded-corners'] into image element data structures.
core/pages.js Restored effectiveClipPath, effectiveBorderRadius, and data-rounded-corners during renderPage and sidebar thumbnail rendering. Added defensive page index resolution.
canvas/canvas.js Synchronized thumbnail renderers for standard and master page image elements with effectiveClip and effectiveRadius.
io/export/canvas-renderer.js Passed clipPath and borderRadius into bakeImageForPrint in bakeSVGFiltersForHtml2Canvas, resetting styles cleanly on baked clones.
io/export/export.js Applied effectiveClip and effectiveRadius to exported images in HTML document exports.
io/file-io.js Enforced effectiveClip, webkitClipPath, and borderRadius on images in print iframe spooler generation.
index.html Updated all 82 cachebuster queries from ?v=5.6.8 to ?v=5.6.9.
ui/dashboard.js Updated template fetch queries from ?v=5.6.8 to ?v=5.6.9.
sw.js Updated Service Worker cache name to open-publisher-v5-6-9 and header comment to (v5.6.9).
extensions/legacy-fixes.js Updated engine startup log message to v5.6.9.
extensions/pwa-install.js Updated header comment and Service Worker registration URL to sw.js?v=5.6.9.
extensions/ui-interactions.js Updated About modal subtitle to β€’ v5.6.9.
ui/modals/options-modal.js Updated header comment to (v5.6.9).
ui/sidebar-context.js Updated header comment to (v5.6.9).

βœ… v5.6.9 Verification Checklist

  • [x] Crop to Shape Modal Clickability: Verified that all 19 shape buttons in the "Crop to Shape" dialog are interactive, clickable, and immediately apply the chosen shape.
  • [x] Right-Click Menu Integration: Verified that right-clicking any canvas image displays "Crop to Shape" directly in the context menu.
  • [x] Playwright Modal Automated Suite: Executed test_crop_to_shape_modal.py verifying Rounded 16px, Circle, Star, Remove Crop, and Right-Click Context Menu with 100% pass rate.
  • [x] Right-Click Rounded Corners (8px, 16px, 24px, 32px): Verified setting rounded corners via context menu applies border-radius, clip-path, and data-rounded-corners attributes.
  • [x] Document State Serialization: Verified that calling serializeCurrentPage serializes clipPath, borderRadius, imgStyle.borderRadius, and filterAttributes['data-rounded-corners'].
  • [x] Page Deserialization (renderPage): Verified that re-rendering from saved state preserves rounded corners and attributes on both the image and container.
  • [x] Physical Print Engine Raster Baking: Verified via pixel inspection that window.bakeImageForPrint with inset(0 round 32px) produces transparent corner pixels (alpha = 0) and opaque center pixels (alpha = 255).
  • [x] Circle & Polygon Crop Printing: Verified circle and polygon clipping paths bake transparent pixels outside shape bounds.
  • [x] Sidebar Thumbnail Consistency: Verified that thumbnail representations accurately reflect corner rounding and shape clipping.
  • [x] Cachebuster Synchronization: All 82 asset queries in index.html and 2 in ui/dashboard.js updated to ?v=5.6.9.
  • [x] Zero Em Dashes: Verified that no em dash symbols are present in release notes or documentation.

πŸŽ‰ Version 5.6.9 - Open Publisher

Source: README.md, updated 2026-10-11