| Name | Modified | Size | Downloads / 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:
- 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. - 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.
- Hardware-Accelerated Fallback Clipping: Initialized print staging element wrappers with
overflow: hiddenandcontain: 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. - 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>). - 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.
- 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. - Document Reload & Serialization Integrity: Enhanced
renderPage()incore/pages.jsto restoreborder-radius,clip-path, andoverflow: hiddenonto.pub-elementand.element-contentfrom serialized document data (effectiveBorderRadius), ensuring saved publications with cropped rounded images reopen with perfect visual fidelity. - Sidebar & Master Page Thumbnail Precision: Updated
createPageThumbnail()and canvas master page previewers to propagate rounded corner radius and clip paths to thumbnailscaleBoxcontainers, ensuring miniature page previews match the main canvas. - Full Codebase Cache & Version Synchronization: Synchronized all 84 asset cachebusters in
index.htmlto?v=5.8.2, incremented the Service Worker cache namespace toopen-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,needsBakeinextensions/print-engine.jsevaluatedisDefaultFillImageLayout(savedImgStyle). Because standard cropped images without CSS filters hadfilter: none,opacity: 1, and noclipPath,needsBakeevaluated tofalse. - The Failure: The print engine bypassed canvas baking and inserted the raw
<img>element into the print staging DOM. Due tocropDiv.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 theneedsBakecondition inextensions/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 atdisplayW * 2bydisplayH * 2. - Pixel-Accurate Mapping:
imgW = parseImageLayoutValue(imgStyle.width, displayW) * scaleimgH = parseImageLayoutValue(imgStyle.height, displayH) * scaleimgL = parseImageLayoutValue(imgStyle.left, displayW) * scaleimgT = parseImageLayoutValue(imgStyle.top, displayH) * scalerasterCtx.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,
needsBakebecametruedue 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:
savedImgStyleretained 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 inextensions/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 to0px: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:
imgwas positioned at(0, 0)withwidth: 100%; height: 100%. Settingborder-radius: 16pxonimgmatched the element bounding box, so rounded corners displayed in both editor and print. - For cropped images:
imgwas positioned at negative coordinates (e.g.left: -40px; top: -30px; width: 140%; height: 150%;). Settingborder-radius: 16pxandclip-path: inset(0 round 16px)only onimgplaced the four curved corners outside the element container. - The container element (
.pub-element) hadoverflow: hiddenand NOborder-radius(sharp 0px rectangle). This rectangular boundary clipped the interior pixels ofimgwith 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): Setel.style.borderRadius = radius;andel.setAttribute('data-rounded-corners', radius);..element-content: Setcontent.style.borderRadius = radius;,content.style.clipPath = clip;,content.style.webkitClipPath = clip;, andcontent.style.overflow = 'hidden';.img: Maintainimg.style.borderRadius = radius;,img.style.clipPath = clip;,img.style.webkitClipPath = clip;, andimg.setAttribute('data-rounded-corners', radius);.- With
clip-path: inset(0 round ${radius})andborder-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 styleel,content, andimgwhen 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 clearborderRadius,clipPath, andoverflow: hiddenacrossel,content, andimg.applyCropShape(ui/ui.js): Synchronized custom shape clipping (circles, ellipses, polygons) across.element-contentand.pub-elementso 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 ontoelandcontentDivwhen exiting crop mode.renderPage(core/pages.js): Restoresborder-radius,clip-path, andoverflow: hiddenontoeland.element-contentwhen loading saved publications.- Thumbnail Generators (
core/pages.js&canvas/canvas.js): UpdatedscaleBoxstyling increatePageThumbnail()andrenderMasterPagePreview()to applyborder-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
isCroppedcondition inneedsBake. - [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: hiddenandcontain: paintfor 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.setRoundedCornerssetsborderRadiusandclipPathon.pub-element,.element-content, andimg. - [x] Rounded Corner Removal: Verified selecting "None" cleanly removes
borderRadius,clipPath, anddata-rounded-cornersacross.pub-element,.element-content, andimg. - [x] Crop to Shape Live Display: Verified geometric crop shapes (circles, ellipses, polygons) propagate across
.element-contentto 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 toelandcontentDiv. - [x] Saved Document Reload: Verified
renderPage()incore/pages.jsrestoresborderRadiusandclipPathon.pub-elementand.element-contentwhen reopening saved publications. - [x] Thumbnail Generator Fidelity: Verified
scaleBoxincore/pages.jsandcanvas/canvas.jsclips cropped thumbnails with rounded corners. - [x] Cache Invalidation & SW Versioning: Verified all 84 asset queries in
index.htmlreference?v=5.8.2,sw.jscache name isopen-publisher-v5-8-2, and all subsystem logs and headers are updated.
π Version 5.8.2 - Open Publisher