Closed labkode closed 6 years ago
This function doesn't add anything to image.Decode
. Imaging is not supposed to be a replacement for the standard image
package. I think it's better to use image.Decode
directly in this case.
As for the current version of imaging.Decode
, I've added it for symmetry with imaging.Encode
and at the time, it also converted image to NRGBA format after decoding. I've removed the conversion later, but the function itself is left for backward compatibility.
The standard go image library provides the format return value when calling Decode. The imaging library provided the FormatFromFilename to get the format of the image (needed for encoding into desired image format). Given that for performing image manipulations the image has to be loaded in memory, the format comes for free when calling img.Decode.
I did not modify the imaging.Decode functions to not break existing users of this library.