Download Latest Version openpublisher5g_amd64-windows.exe (81.1 MB)
Home / 5.8.2
Name Modified Size InfoDownloads / Week
Parent folder
5.8.2_ Image Crop Print Fidelity _ Live Editor Rounded Corners source code.tar.gz 2026-10-14 22.5 MB
5.8.2_ Image Crop Print Fidelity _ Live Editor Rounded Corners source code.zip 2026-10-14 22.8 MB
README.md 2026-10-14 14.6 kB
OpenPublisher5-i386-windowsXP.exe 2026-10-14 56.5 MB
openpublisher5_amd64-windows-portable.exe 2026-10-14 183.2 MB
openpublisher5_amd64-windows.exe 2026-10-14 165.2 MB
openpublisher5_amd64-macos.dmg 2026-10-14 233.1 MB
openpublisher5_amd64-linux.run 2026-10-14 193.4 MB
openpublisher5_amd64-linux.rpm 2026-10-14 215.4 MB
openpublisher5_amd64-linux.flatpak 2026-10-14 153.6 MB
openpublisher5_amd64-linux.deb 2026-10-14 156.2 MB
openpublisher5_amd64-linux.AppImage 2026-10-14 166.4 MB
openpublisher5_amd64-freebsd.pkg 2026-10-14 185.5 MB
Totals: 13 Items   1.8 GB 0

πŸš€ Summary

Version 5.8.2 resolves critical discrepancies between the canvas editor and print engine for cropped images, delivers retina-grade 2x sub-viewport rasterization for cropped picture elements, eliminates aspect-ratio stretching on adjusted images, and brings live rounded corner masking directly to cropped images in the canvas editor:

  1. Cropped Image Print Fidelity: Fixed an issue where images cropped on the canvas printed completely uncropped when sent to the printer or PDF export. The print engine now detects cropped image geometry (!isDefaultFillImageLayout) and routes images through the high-resolution pre-render pipeline.
  2. Aspect-Ratio Stretch & "Huge Image Chunk" Elimination: Fixed an issue where applying any image adjustment (such as hue rotation, saturation, brightness, contrast, or sepia) to a cropped image caused the cropped area to stretch to the oversized footprint of the uncropped source. Cropped images with filters now print with exact 1:1 aspect ratio fidelity and zero distortion.
  3. Hardware-Accelerated Fallback Clipping: Initialized print staging element wrappers with overflow: hidden and contain: paint. If an external image cannot be rasterized due to CORS constraints, the browser fallback cleanly clips uncropped image portions at the exact crop boundaries.
  4. Live Canvas Rounded Corner Masking for Cropped Images: Solved the longstanding editor visual defect where applying rounded corners (8px, 16px, 24px, 32px) to a cropped image rendered rounded corners on prints but left sharp 90-degree rectangle corners in the canvas editor. Rounded corner clipping now applies across the container element (.pub-element), the content wrapper (.element-content), and the inner image (<img>).
  5. Crop to Shape Live Editor Synchronization: Extended geometric shape clipping (circles, ellipses, rounded rectangles, stars, polygons) across the element container hierarchy so custom crop shapes display identically in both the canvas editor and physical prints.
  6. Crop Mode Exit Persistence: When exiting interactive crop mode (state.cropMode = false), Open Publisher checks for existing rounded corner attributes (data-rounded-corners) or shape paths and re-applies smooth masking to the element wrapper and content div.
  7. Document Reload & Serialization Integrity: Enhanced renderPage() in core/pages.js to restore border-radius, clip-path, and overflow: hidden onto .pub-element and .element-content from serialized document data (effectiveBorderRadius), ensuring saved publications with cropped rounded images reopen with perfect visual fidelity.
  8. Sidebar & Master Page Thumbnail Precision: Updated createPageThumbnail() and canvas master page previewers to propagate rounded corner radius and clip paths to thumbnail scaleBox containers, ensuring miniature page previews match the main canvas.
  9. Full Codebase Cache & Version Synchronization: Synchronized all 84 asset cachebusters in index.html to ?v=5.8.2, incremented the Service Worker cache namespace to open-publisher-v5-8-2, and updated all subsystem headers, logs, and dialog subtitles.

πŸ” Architecture & Technical Implementation

1. Root Cause Analysis: Uncropped Print Output

  • The Issue: When users inserted an image and cropped it, the canvas editor displayed the cropped viewport by applying inline positioning (position: absolute; left: -Xpx; top: -Ypx; width: Wpx; height: Hpx;) to the inner <img> while clipping through the container. However, when printed, needsBake in extensions/print-engine.js evaluated isDefaultFillImageLayout(savedImgStyle). Because standard cropped images without CSS filters had filter: none, opacity: 1, and no clipPath, needsBake evaluated to false.
  • The Failure: The print engine bypassed canvas baking and inserted the raw <img> element into the print staging DOM. Due to cropDiv.style.overflow = 'visible', the uncropped portions of the image overflowed the bounding box, rendering the entire uncropped image on prints.
  • The Solution: Added const isCropped = !isDefaultFillImageLayout(savedImgStyle); to the needsBake condition in extensions/print-engine.js. Any image with custom offsets or dimensions automatically triggers high-resolution sub-rectangle rendering.

2. High-Resolution Sub-Viewport Baking (extensions/print-engine.js)

  • 2x Scale Sub-Rectangle Sampling: When bakeImageForPrint() processes a cropped image, it allocates a dedicated staging canvas at displayW * 2 by displayH * 2.
  • Pixel-Accurate Mapping: imgW = parseImageLayoutValue(imgStyle.width, displayW) * scale imgH = parseImageLayoutValue(imgStyle.height, displayH) * scale imgL = parseImageLayoutValue(imgStyle.left, displayW) * scale imgT = parseImageLayoutValue(imgStyle.top, displayH) * scale rasterCtx.drawImage(tempImg, imgL, imgT, imgW, imgH)
  • Boundary Clamping: The canvas boundary acts as the exact crop frame at 200% DPI, capturing the intended sub-rectangle with crisp anti-aliasing and zero edge bleeding.

3. Root Cause Analysis: Stretched "Huge Image Chunk" Distortion

  • The Issue: When a user applied a tiny adjustment (such as hue, saturation, contrast, or brightness) to a cropped image, needsBake became true due to the filter. The sub-viewport canvas was correctly baked to the cropped dimensions. However, after baking, the resulting <img> in the print staging DOM was assigned: img.style.cssText = savedImgStyle;
  • The Failure: savedImgStyle retained the uncropped sizing (width: 150%; height: 180%; left: -25%; top: -30%;). Because the image source was replaced with the already-cropped canvas raster, the browser stretched the cropped pixels into the oversized footprint that the uncropped original previously occupied, producing huge, distorted image chunks.
  • The Solution: Reset the post-bake <img> styles in extensions/print-engine.js:
  • When no drop shadow padding is present (padW === 0 && padH === 0): img.style.position = 'absolute'; img.style.left = '0px'; img.style.top = '0px'; img.style.width = '100%'; img.style.height = '100%'; img.style.objectFit = 'fill';
  • When drop shadow padding is present (padW > 0 || padH > 0), clear negative offsets and align the padded canvas relative to 0px: img.style.left = (-padX / scale) + 'px'; img.style.top = (-padY / scale) + 'px'; img.style.width = ((displayW * scale + padW) / scale) + 'px'; img.style.height = ((displayH * scale + padH) / scale) + 'px'; This eliminates all coordinate distortion and guarantees 1:1 aspect ratio fidelity.

4. Root Cause Analysis: Sharp Editor Corners on Cropped Images

  • The Issue: When a user applied rounded corners (e.g. 16px) via Context Menu -> Rounded Corners:
  • For uncropped images: img was positioned at (0, 0) with width: 100%; height: 100%. Setting border-radius: 16px on img matched the element bounding box, so rounded corners displayed in both editor and print.
  • For cropped images: img was positioned at negative coordinates (e.g. left: -40px; top: -30px; width: 140%; height: 150%;). Setting border-radius: 16px and clip-path: inset(0 round 16px) only on img placed the four curved corners outside the element container.
  • The container element (.pub-element) had overflow: hidden and NO border-radius (sharp 0px rectangle). This rectangular boundary clipped the interior pixels of img with sharp 90-degree corners, hiding the rounded corners in the editor.
  • The Solution: Propagate rounded corner styling across the element hierarchy:
  • state.selectedEl (.pub-element): Set el.style.borderRadius = radius; and el.setAttribute('data-rounded-corners', radius);.
  • .element-content: Set content.style.borderRadius = radius;, content.style.clipPath = clip;, content.style.webkitClipPath = clip;, and content.style.overflow = 'hidden';.
  • img: Maintain img.style.borderRadius = radius;, img.style.clipPath = clip;, img.style.webkitClipPath = clip;, and img.setAttribute('data-rounded-corners', radius);.
  • With clip-path: inset(0 round ${radius}) and border-radius: ${radius} applied to .element-content, the cropped image inside it is masked with smooth rounded corners on the canvas editor.

5. Multi-Point Synchronization (ui/ui.js, ui/menus.js, elements/image/image.js, core/pages.js, canvas/canvas.js)

  • ContextMenuActions.setRoundedCorners (ui/ui.js): Updated to style el, content, and img when setting any radius (8px, 16px, 24px, 32px) and to cleanly clear all styles when selecting "None".
  • ui/menus.js: Updated inline fallback handlers for None, 8px, 16px, 24px, and 32px to set and clear borderRadius, clipPath, and overflow: hidden across el, content, and img.
  • applyCropShape (ui/ui.js): Synchronized custom shape clipping (circles, ellipses, polygons) across .element-content and .pub-element so non-rectangular crop shapes display accurately on cropped images in the editor.
  • window.toggleCrop (elements/image/image.js): Re-applies saved rounded corner radius (data-rounded-corners) and clip paths onto el and contentDiv when exiting crop mode.
  • renderPage (core/pages.js): Restores border-radius, clip-path, and overflow: hidden onto el and .element-content when loading saved publications.
  • Thumbnail Generators (core/pages.js & canvas/canvas.js): Updated scaleBox styling in createPageThumbnail() and renderMasterPagePreview() to apply border-radius: ${effectiveRadius}; clip-path: inset(0 round ${effectiveRadius}); overflow: hidden; for miniature preview fidelity.

πŸ“ Files Modified in 5.8.2

File Changes
extensions/print-engine.js Added isCropped condition to needsBake, initialized cropDiv.style.overflow = 'hidden' with fallback paint containment, normalized post-bake <img> coordinates to (0, 0, 100%, 100%) to eliminate image chunk stretching, and updated version header to (v5.8.2).
ui/ui.js Updated ContextMenuActions.setRoundedCorners to apply borderRadius, clipPath, and overflow: hidden to container .pub-element and .element-content as well as inner img. Updated applyCropShape to synchronize custom clip paths and rounded corner definitions across element hierarchy.
ui/menus.js Updated inline fallback actions for context menu "Rounded Corners" (None, 8px, 16px, 24px, 32px) to style .pub-element and .element-content.
elements/image/image.js Simplified top-level toggleCrop to delegate to window.toggleCrop, and updated exit from crop mode to re-apply saved rounded corners (data-rounded-corners) and shape clip paths with overflow: hidden on container and content wrapper.
core/pages.js Updated renderPage() to restore border-radius, clip-path, and overflow: hidden onto .pub-element and .element-content from serialized effectiveBorderRadius / effectiveClipPath. Updated createPageThumbnail() so scaleBox applies border-radius and clip-path for cropped image thumbnails.
canvas/canvas.js Updated master page thumbnail preview and page element preview scaleBox to inherit border-radius and clip-path for cropped image elements.
index.html Synchronized all 84 asset cachebusters to ?v=5.8.2.
sw.js Bumped Service Worker cache namespace to open-publisher-v5-8-2 and header to (v5.8.2).
extensions/pwa-install.js Bumped header to (v5.8.2) and Service Worker registration query to sw.js?v=5.8.2.
extensions/ui-interactions.js Bumped header comment, startup console log, and About dialog subtitle to v5.8.2.
extensions/legacy-fixes.js Bumped engine initialization console log to v5.8.2.
tools/proofing/spellcheck-engine.js Bumped proofing header comment to (v5.8.2).
ui/dashboard.js Updated template fetch cachebuster queries to ?v=5.8.2.
ui/sidebar-context.js Bumped sidebar context header comment to (v5.8.2).
ui/modals/card-sheet-modal.js Bumped card sheet modal header comment to (v5.8.2).
ui/modals/options-modal.js Bumped options modal header comment to (v5.8.2).

wrapper.html was not modified.


βœ… v5.8.2 Verification Checklist

  • [x] Cropped Image Print Output: Verified unadjusted cropped images print with exact cropped bounds via isCropped condition in needsBake.
  • [x] Eliminated Image Chunk Stretching: Verified cropped images with adjustments (hue offset, brightness, contrast, saturation) print without stretching by normalizing post-bake <img> positioning to (0, 0, 100%, 100%).
  • [x] Fallback Paint Containment: Verified fallback staging containers maintain overflow: hidden and contain: paint for unbaked images.
  • [x] Live Canvas Rounded Corners for Cropped Images: Verified rounded corners (8px, 16px, 24px, 32px) appear smoothly on cropped images in the canvas editor, matching print output.
  • [x] Container Hierarchy Propagation: Verified ContextMenuActions.setRoundedCorners sets borderRadius and clipPath on .pub-element, .element-content, and img.
  • [x] Rounded Corner Removal: Verified selecting "None" cleanly removes borderRadius, clipPath, and data-rounded-corners across .pub-element, .element-content, and img.
  • [x] Crop to Shape Live Display: Verified geometric crop shapes (circles, ellipses, polygons) propagate across .element-content to display accurately on cropped images in the editor.
  • [x] Crop Mode Exit Restoration: Verified exiting crop mode (toggleCrop) preserves and re-applies rounded corners and clip paths to el and contentDiv.
  • [x] Saved Document Reload: Verified renderPage() in core/pages.js restores borderRadius and clipPath on .pub-element and .element-content when reopening saved publications.
  • [x] Thumbnail Generator Fidelity: Verified scaleBox in core/pages.js and canvas/canvas.js clips cropped thumbnails with rounded corners.
  • [x] Cache Invalidation & SW Versioning: Verified all 84 asset queries in index.html reference ?v=5.8.2, sw.js cache name is open-publisher-v5-8-2, and all subsystem logs and headers are updated.

πŸŽ‰ Version 5.8.2 - Open Publisher

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