Skip to content

Conversation

ReFFaT
Copy link
Contributor

@ReFFaT ReFFaT commented Oct 5, 2025

Fixed SVG image insertion via URL paste and copy/paste.

Problem: Browser renders SVG with 0x0 dimensions when width/height attributes are missing.

Solution:

  • Added default dimensions 300x200 for SVG without size attributes
  • Preload SVG to extract actual dimensions before insertion
  • Added 2-second timeout fallback for slow loading images

Note: SVG images are loaded twice (dimension detection + rendering), but the second load
uses browser cache, making the performance impact negligible.

Fixes issue where SVG images rendered with 0x0 size in editor

@ReFFaT
Copy link
Contributor Author

ReFFaT commented Oct 5, 2025

@gravity-ui-bot
Copy link
Contributor

Preview is ready.

@gravity-ui-bot
Copy link
Contributor

Visual Tests Report is ready.

@ReFFaT ReFFaT force-pushed the fix(iamgeSize)--fixed-the-insertion-of-the-svg-image branch from 1bf2f42 to 118f136 Compare October 17, 2025 11:44
@ReFFaT ReFFaT merged commit e70da1b into main Oct 18, 2025
5 checks passed
@ReFFaT ReFFaT deleted the fix(iamgeSize)--fixed-the-insertion-of-the-svg-image branch October 18, 2025 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants