Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image/jpeg: Decode incorrectly complains about missing SOF marker #12784

Closed
ghost opened this issue Sep 29, 2015 · 3 comments
Closed

image/jpeg: Decode incorrectly complains about missing SOF marker #12784

ghost opened this issue Sep 29, 2015 · 3 comments
Milestone

Comments

@ghost
Copy link

ghost commented Sep 29, 2015

http://play.golang.org/p/qUNLzBVraB

The image was generated using ImageMagick and libjpeg's cjpeg and is a valid image with a SOF0 marker, but Decode() complains about invalid JPEG format: missing SOF marker.

@bradfitz bradfitz added this to the Go1.6 milestone Sep 29, 2015
@ALTree
Copy link
Member

ALTree commented Oct 25, 2015

If I dump your jpg array to file and then try to decode it I get

$ djpeg ~/Desktop/imm.jpg 
Corrupt JPEG data: 3 extraneous bytes before marker 0xc4
Invalid JPEG file structure: SOS before SOF

Are you sure you are using a valid JPEG image?

@ghost
Copy link
Author

ghost commented Oct 25, 2015

@ALTree Oops. Something went wrong. Closing the issue as invalid.

@ghost ghost closed this as completed Oct 25, 2015
@emad-elsaid
Copy link

For the record, I stumbled across this issue while debugging an image resizer, I had some images that wasn't resized and the error message was the same as this issue, so I tried to get the type of the file and turns out to be png and I forgot to import the png and also gif decoders to my app.

just to save some time for other people who gets here.

@golang golang locked and limited conversation to collaborators Sep 27, 2017
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants