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: Invalid SOS parameters for sequential JPEG #3916

Closed
gopherbot opened this issue Aug 7, 2012 · 4 comments
Closed

image/jpeg: Invalid SOS parameters for sequential JPEG #3916

gopherbot opened this issue Aug 7, 2012 · 4 comments

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Aug 7, 2012

by LewGun:

the picture which was encoded by image/jpeg. can't be operate by  GraphicsMagick
with error:
  gm convert: Invalid SOS parameters for sequential JPEG (D:/src.jpg).

What steps will reproduce the problem?
1. create a picture by image/jpeg
2. endcode and save it
3. gm convert D:/src.jpg D:/dst.jpg

What is the expected output?
 picture: "d:/dst.jpg" with nothing be output to console

What do you see instead?
 picture: "d:/dst.jpg" with "gm convert: Invalid SOS parameters for sequential JPEG (D:/src.jpg)."


Which compiler are you using (5g, 6g, 8g, gccgo)?
8g

Which operating system are you using?
win7-64bit

Which version are you using?  (run 'go version')
go version go1.0.1

Please provide any additional information below.

these steps will be ok.
 1. convert to png:
   C:\Users\xx>gm convert D:/src.jpg D:/dst1.png
   gm convert: Invalid SOS parameters for sequential JPEG (D:/src.jpg).

2. convert from png to jpeg
   C:\Users\xx>gm convert D:/dst1.png D:/dst2.jpg

3. convert from jpeg to jpeg
  C:\Users\xx>gm convert D:/dst2.jpg D:/dst.jpg

4. there is a picture: D:/dst.jpg with nothing be output
@minux
Copy link
Member

@minux minux commented Aug 7, 2012

Comment 1:

relevant golang-nuts discussion:
https://groups.google.com/d/msg/golang-nuts/wvwDIfuPmlw/WPMWfglu5XUJ

Loading

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Aug 7, 2012

Comment 2:

Attaching the sample image from the mailing list thread that reportedly shows this
behavior.

Attachments:

  1. xx.jpg (160063 bytes)

Loading

@nigeltao
Copy link
Contributor

@nigeltao nigeltao commented Aug 7, 2012

Comment 3:

Owner changed to @nigeltao.

Status changed to Accepted.

Loading

@nigeltao
Copy link
Contributor

@nigeltao nigeltao commented Aug 7, 2012

Comment 4:

This issue was closed by revision 5f7bec6.

Status changed to Fixed.

Loading

nigeltao added a commit that referenced this issue May 11, 2015
…eader.

««« backport 4a67b1f1e771
image/jpeg: send a correct Start Of Scan (SOS) header.

Section B.2.3 of http://www.w3.org/Graphics/JPEG/itu-t81.pdf discusses
the End of spectral selection (Se) byte.

Apparently many JPEG decoders ignore the Se byte (or let it through
with a warning), but some configurations reject them. For example,
http://download.blender.org/source/chest/blender_2.03_tree/jpeg/jcmaster.c
has these lines:

if (Ss != 0 || Se != DCTSIZE2-1 || Ah != 0 || Al != 0)
  ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);

Fixes #3916.

R=r
CC=golang-dev
https://golang.org/cl/6459052

»»»
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
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
4 participants