NetBox sets Pillow's MAX_IMAGE_PIXELS to 25 MP, so Pillow rejects images
above 50 MP as decompression bombs. Raise the limit to 100 MP while the
bulk upload is processed and surface the underlying Pillow error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rack elevation page's "Bilder und Beschriftungen" dropdown only
toggles CSS visibility client-side after the browser already has the
SVG, so a freshly server-rendered export had no way to know which mode
was selected and always exported everything.
apply_rack_view_mode() replicates that filtering server-side by
removing the .label text elements (images-only) or the .device-image /
.device-image-label elements (labels-only) from the parsed SVG.
RackElevationOfflineSVGView now accepts a ?view= query param, and the
rack detail page panel syncs its download links to the page's own
"select.rack-view" dropdown so the exported file matches what's
currently shown.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
strip_svg_hyperlinks() removed every href, including on <image>
elements that reference device-type photos, leaving devices with
images blank in the exported file. Non-anchor hrefs (currently only
<image>) are now resolved through an optional image_loader callback
and embedded as base64 data URIs instead of being stripped; anchor
unwrapping is unchanged. RackElevationOfflineSVGView wires this up to
NetBox's MEDIA storage.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- RackElevationOfflineSVGView called .render() unconditionally on the
RackViewSet elevation action's response, but that action returns a
plain HttpResponse (not a DRF Response) when render=svg is
requested, causing AttributeError on every click.
- effective_width_positions() crashed with decimal.InvalidOperation
when a device had no rack position set (e.g. surfaced via NetBox
Topology Views, which includes unracked devices). Such devices now
get the default full-width result instead of entering the Decimal
conversion.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds a "SVG offline" download button on the rack detail page. It
reuses NetBox's own rack-elevation REST endpoint to render the SVG,
then strips embedded <a>/xlink:href links (which point at internal,
relative NetBox URLs and are useless once the file is saved) so the
result renders identically when opened standalone in any SVG viewer.
Gated by the new offline_svg_export_enabled plugin setting (on by
default).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>