Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Adds support for two components images #14

Merged
merged 1 commit into from

2 participants

Yury Delendik notmasteryet
notmasteryet notmasteryet merged commit 6516959 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 24, 2012
  1. Yury Delendik
This page is out of date. Refresh to see the latest.
Showing with 16 additions and 1 deletion.
  1. +16 −1 jpg.js
17 jpg.js
View
@@ -764,6 +764,21 @@ var JpegImage = (function jpegImage() {
}
}
break;
+ case 2:
+ // PDF might compress two component data in custom colorspace
+ component1 = this.components[0];
+ component2 = this.components[1];
+ for (y = 0; y < height; y++) {
+ component1Line = component1.lines[0 | (y * component1.scaleY * scaleY)];
+ component2Line = component1.lines[0 | (y * component2.scaleY * scaleY)];
+ for (x = 0; x < width; x++) {
+ Y = component1Line[0 | (x * component1.scaleX * scaleX)];
+ data[offset++] = Y;
+ Y = component2Line[0 | (x * component2.scaleX * scaleX)];
+ data[offset++] = Y;
+ }
+ }
+ break;
case 3:
// The default transform for three components is true
colorTransform = true;
@@ -908,4 +923,4 @@ var JpegImage = (function jpegImage() {
};
return constructor;
-})();
+})();
Something went wrong with that request. Please try again.