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
opennota opened this issue Sep 29, 2015 · 3 comments
Closed

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

opennota opened this issue Sep 29, 2015 · 3 comments
Assignees
Milestone

Comments

@opennota
Copy link

@opennota opennota 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 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?

Loading

@opennota
Copy link
Author

@opennota opennota commented Oct 25, 2015

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

Loading

@opennota opennota closed this Oct 25, 2015
@emad-elsaid
Copy link

@emad-elsaid emad-elsaid commented Sep 27, 2016

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.

Loading

@golang golang locked and limited conversation to collaborators Sep 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants