image/jpeg: Decode valid JPEG from guetzli returns error "invalid JPEG format: bad Th value" #19913
Labels
FrozenDueToAge
help wanted
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Please answer these questions before submitting your issue. Thanks!
What did you do?
Passed a guetzli-encoded JPEG stream (https://dl.dropboxusercontent.com/u/337227/bees.jpg) to
jpeg.Decode
:What did you expect to see?
When using the above-mentioned
bees.jpg
image:What did you see instead?
Additional details
I first discovered this problem with the sample
bees.png
image from the Guetzli project, which I had encoded with guetzli to a JPEG using default settings (see https://github.com/google/guetzli#using;bees.png
is the "sample high quality image"):This doesn't happen with all guetzli-encoded JPEGs. I don't know anything about image compression, but grayscale images and normal line-drawing, solid-color PNGs that are guetzli-encoded to JPEG, for example, don't appear to exhibit this problem. I can generate "broken" images fairly reliably by converting color JPEG photographs to PNGs (via
sips
, comes with macOS) and then back to JPEGs using guetzli:main.go:
$ sips -s format png ~/Downloads/some-image.jpg --out image.png $ guetzli image.png guetzli-image.jpg $ go run main.go guetzli-image.jpg 2017/04/10 12:19:11 jpeg: invalid JPEG format: bad Th value panic: jpeg: invalid JPEG format: bad Th value
Does this issue reproduce with the latest release (go1.8.1)?
Yes, this issue reproduces with:
tip
26c2926System details
The text was updated successfully, but these errors were encountered: