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

Fix loading of inline JPEG images #5286

Merged
merged 2 commits into from
Sep 11, 2014
Merged

Fix loading of inline JPEG images #5286

merged 2 commits into from
Sep 11, 2014

Conversation

Snuffleupagus
Copy link
Collaborator

This is a tentative patch to fix loading of inline JPEG images, based on this paragraph: http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf#page=223&zoom=auto,0,600.

Fixes #2812.
Fixes #4776.
Fixes bug 1065245

Also fixes missing images in (but the text is still incorrect):
#2840.
#4054.

@Snuffleupagus
Copy link
Collaborator Author

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_preview from @Snuffleupagus received. Current queue size: 0

Live output at: http://107.21.233.14:8877/dc3812998057c18/output.txt

// Hence when the first byte of the stream of an inline JPEG image is
// a whitespace character, we thus simply skip over it.
if (isCmd(this.buf1, 'ID')) {
var firstByte = stream.peekBytes(1)[0];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would you consider implementing a peekByte() in Stream?

peekByte: function Stream_peekByte() {
  var byte = this.getByte();
  this.pos--;
  return byte;
},

i think thats cleaner

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually considered doing that, but I wasn't sure if it belonged in this PR or in a followup.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its not there because nobody needs it right now. So I would say its valid to be part of this PR (maybe a second commit). I think that API should be there, and the actual way of getting it merged doesnt matter much :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are more than three implementations of abstract Stream class, peekByte will be a big effort for this PR

@yurydelendik
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @yurydelendik received. Current queue size: 0

Live output at: http://107.22.172.223:8877/6f7a74ae5c2e5d5/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_test from @yurydelendik received. Current queue size: 0

Live output at: http://107.21.233.14:8877/527722b317e1bd3/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/6f7a74ae5c2e5d5/output.txt

Total script time: 19.69 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/527722b317e1bd3/output.txt

Total script time: 22.56 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

yurydelendik added a commit that referenced this pull request Sep 11, 2014
@yurydelendik yurydelendik merged commit 0d72784 into mozilla:master Sep 11, 2014
@yurydelendik
Copy link
Contributor

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PDF not rendering pdf doesn't load.
4 participants