diff --git a/CHANGELOG.md b/CHANGELOG.md index 328c44fd3..293da6f0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -81,6 +81,7 @@ All notable changes to this project will be documented in this file. - [#2471] SVG Export - exporting with font-face - text tags with multiple texts, fix invalid family names, incorrect text size - Replacing existing characters in a font which has character codes unsorted +- [#2475] SVG Import - ignoring gradients caused by missing offset attribute of stop element ## [23.0.1] - 2025-05-16 ### Fixed @@ -3886,6 +3887,7 @@ Major version of SWF to XML export changed to 2. [#1646]: https://www.free-decompiler.com/flash/issues/1646 [#2469]: https://www.free-decompiler.com/flash/issues/2469 [#2471]: https://www.free-decompiler.com/flash/issues/2471 +[#2475]: https://www.free-decompiler.com/flash/issues/2475 [#2427]: https://www.free-decompiler.com/flash/issues/2427 [#1826]: https://www.free-decompiler.com/flash/issues/1826 [#2448]: https://www.free-decompiler.com/flash/issues/2448 diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/svg/SvgStyle.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/svg/SvgStyle.java index 2604ec9e2..a27fdd231 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/svg/SvgStyle.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/svg/SvgStyle.java @@ -557,8 +557,10 @@ class SvgStyle { Element stopEl = (Element) node; SvgStyle newStyle = new SvgStyle(importer, idMap, stopEl, cachedBitmaps); - String offsetStr = stopEl.getAttribute("offset"); - double offset = importer.parseNumberOrPercent(offsetStr); + double offset = 0; + if (stopEl.hasAttribute("offset")) { + offset = importer.parseNumberOrPercent(stopEl.getAttribute("offset")); + } Color color = newStyle.getStopColor(); if (color == null) { color = Color.BLACK;