Skip to content

Split getSupportedFormats into getSupportedInputFormats and getSupportedOutputFormats #815

Open
@alexander-schranz

Description

@alexander-schranz

Description

I did see a new getSupportedFormats was added. Which I think is a great addition. I'm not sure if we should go with a general supportedFormats. As from my point of view there are 2 supportedFormats methods needed. One for inputFormats so which format I can in general read with that adapter and on for outputFormats which formats I can output. Example depending on the installed imagemagick libraries I can also read adobe files but can not output them, same for other vector files like svg can be read but not outputted

Example Interface changes:

/** @return string[] */
public function getSupportedInputFormats(): array;

/** @return string[] */
public function getSupportedOutputFormats(string $inputFormat = null): array;

Why?

Why we should implement something like this. As example I have the imagine imagick and imagine vips adapter installed. For all things I want to use the vips adapter aslong as the vips adapter support the specific inputFormat -> outputFormat if not I will fallback to the imagick adapter which supports more formats.

Another usecase is I want to use SVGImagine adapter to convert resize svg -> svg but when I need to convert svg->png I want to use the Imagick adapter.

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