Urgent.News

What's breaking now, across thousands of outlets.

Tech

Your SVG optimizer silently broke your icon. Here's the one-line check.

Your SVG optimizer silently broke your icon. Here's the one-line check. I spent an afternoon comparing SVG optimizers on a set of 28 real icons from Simple Icons. The sizes looked fine. Two files made the batch tool crash. Three of them produced a file that opened without complaint, rendered as a blank square, and reported a smaller byte count than the original. The reason: the optimizer had…

Your SVG optimizer may have inadvertently corrupted your icons. An investigation into a set of 28 real icons revealed that the optimizer replaced path coordinates with the invalid string "NaN", causing certain icons to either be blank squares or render incorrectly. This occurred due to the optimizer's handling of arc commands and the optional spacing of flags within them.

The issue was version-dependent, with different optimizers producing varying results when parsing and formatting numbers. A quick "one-line check" using grep to search for the literal string "NaN" within the SVG file can detect this defect. The optimizer's preview may show a seemingly flawless icon, but the downloaded file could be broken.

To safeguard against this, it is recommended to search for "NaN" in the output file before using it, as well as compare the final drawing to the original source at the final display size. This process can help ensure that the replaced icons maintain their intended appearance and functionality.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Kubernetes 1.33: What Really Breaks During an Upgrade and How to Anticipate It

Every cluster operator remembers Kubernetes 1.16 and 1.22: whole API groups disappeared overnight, Helm charts exploded, and kubectl apply started returning no matches for kind .

  • Several changes in Kubernetes 1.33 can break clusters during upgrade
  • Watch feature gates, kubelet default behavior, and aggregated APIService endpoints
  • Comprehensive upgrade plan with Pluto and Kubent recommended

More from Thursday 19 November →