Open alexander-schranz opened 2 years ago
Yep, that'd be nice, but I don't think it's possible. For example, we know the formats supported by Imagick by using the Imagick::queryFormats()
method, which doesn't give details about encoding/decoding capabilities...
which doesn't give details about encoding/decoding capabilities
But we could report them then for both, intput and output formats. And in the future we could add better checks if possible.
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 generalsupportedFormats
. As from my point of view there are 2 supportedFormats methods needed. One forinputFormats
so which format I can in general read with that adapter and on foroutputFormats
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 outputtedExample Interface changes:
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 thevips
adapter support the specificinputFormat
->outputFormat
if not I will fallback to theimagick
adapter which supports more formats.Another usecase is I want to use SVGImagine adapter to convert resize
svg
->svg
but when I need to convertsvg
->png
I want to use the Imagick adapter.