Image derivatives fail with null height/width

Created on 22 January 2025, 2 months ago

Problem/Motivation

My client has a media type that allows .svg files in the image field. It's not what I recommend to mix these types but I can't get them to change it. Problem is if one of these files show up as svg and i'm querying for image style height or width, I get a type error as those properties are set to non null.

Steps to reproduce

Allow .svg uploads for an image field, upload a .svg for an entity and query for it in explorer. If you just query 'url', no problem but if you include 'height' or 'width', graphql will return error as there is never going to be a height/width for .svg files.

Proposed resolution

The default image has a fallback for height/width set to 0 so I propose doing the same for the derivative.

Remaining tasks

I will provide a patch.

User interface changes

Explorer will return 0 for height/width on svg image derivatives.

πŸ› Bug report
Status

Active

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States apmsooner

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024