Skip to content

Device image scaling in rack view - switch from "fill" to "fit" #18876

@fknorn

Description

@fknorn

NetBox version

v4.2.5

Feature type

Change to existing functionality

Proposed functionality

This was briefly discussed in here: #15346

When having a device which is, let's say, only half the width of a 19" rack slot, the current preserveAspectRatio="xMidYMid slice" on the HTML image element results in the image "covering" the entire slot. This leads to it being shown incorrectly in the sense that it doesn't match the real world "look".

Image

When swapping slice for meet, the display is correct:

Image

I assume there has been some though put into the slice attribute (in other contexts referred to as "cover" or "fill") versus meet (aka "fit") being used.

But would it not make more sense to use "meet", in order to fit a device's height into the visual slot?

Use case

It displays devices correctly that don't have the 10:n aspect ratio (n being the number of heigh units covered). For example smaller ISR-routers, or indeed devices that are 5/3rd U tall (they exists too :/).

Database changes

None

External dependencies

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity: lowRequires minimal effort to implementpending closureRequires immediate attention to avoid being closed for inactivitystatus: needs ownerThis issue is tentatively accepted pending a volunteer committed to its implementationtype: featureIntroduction of new functionality to the application

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions