Golang image.Decode() raises error for many images and this problem is not solved for a long term. This module solves it by external software, ImageMagick.
First, you need to install ImageMagick(https://imagemagick.org/). Then
go get github.com/lamrongol/go-imagemagick-decode
Use magick.Decode() instead of image.Decode()
image.Decode() fail cases are reported on following:
This module can decode for all of above cases. You can confirm by image_test.go.
You can also confirm by https://hub.docker.com/r/lamrongol/golang-imagemagick
In Japanese
Goのimage.Decode()は多くの画像でエラーを起こし、この問題は長年に渡って解決されていません。このモジュールは外部ソフトウェアImageMagickを使用してDecodeします。
まずImageMagick(https://imagemagick.org/)をインストールする必要があります。そして
go get github.com/lamrongol/go-imagemagick-decode
その後image.Decode()の代わりにmagick.Decode()を使用します。
image.Decode()が失敗するケースは公式レポジトリの以下のIssueで報告されています。
このモジュールは上のすべてのケースをDecodeできます。image_test.goで確認できます。
https://hub.docker.com/r/lamrongol/golang-imagemagick でも確認できます。