ipx
ipx copied to clipboard
Cannot request `svg` output format for `svg` source files
Environment
ipx v3.0.3
Reproduction
n/a
Describe the bug
Requesting an SVG source file without specifying an output format is allowed — it returns the SVG file unmodified (or optimised, if SVGO is enabled).
But requesting an SVG source file and explicitly specifying svg as the output format produces a JPEG output file.
This is because other file types cannot be converted to SVG, so svg is not listed in SUPPORTED_FORMATS and unsupported formats are transformed to jpeg.
The logic ought to be amended so that SVG -> SVG is acceptable.
Additional context
The relevant logic is here:
https://github.com/unjs/ipx/blob/af698d08e6c96e3e551d03a07c045234980b54ff/src/ipx.ts#L224-L252
Logs