Skip to content

Format modifier cannot be unset #2001

Description

@Tofandel

IPX does not have the svg format modifier, this means that if you add in your nuxt config

image: {
  ipx: {
    modifiers: {
      format: 'webp',
    }
  }
}

And then for some svg images you want to override the format to avoid it being converted into an inferior format, none of those solutions will work

<NuxtImage src="my.svg" format="svg">
<!-- Results in ipx f_svg, but ipx doesn't support svg output (even though the original is already svg) -->
<NuxtImage src="my.svg" :format="null">
<!-- Results in ipx f_webp -->
<NuxtImage src="my.svg" :modifiers="{format: null}">
<!-- Results in ipx f_webp -->

Using format auto will also not result in a svg output

So we need a way to either discard the default modifiers or a format "original" in ipx

Added a fix for the first case in unjs/ipx#281

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions