Merge pull request #3390 from yurydelendik/jpgjs-2
Implements FFC1 marker (and syncs with jpgjs)
This commit is contained in:
commit
c065b817f3
17
external/jpgjs/jpg.js
vendored
17
external/jpgjs/jpg.js
vendored
@ -668,9 +668,11 @@ var JpegImage = (function jpegImage() {
|
||||
break;
|
||||
|
||||
case 0xFFC0: // SOF0 (Start of Frame, Baseline DCT)
|
||||
case 0xFFC1: // SOF1 (Start of Frame, Extended DCT)
|
||||
case 0xFFC2: // SOF2 (Start of Frame, Progressive DCT)
|
||||
readUint16(); // skip data length
|
||||
frame = {};
|
||||
frame.extended = (fileMarker === 0xFFC1);
|
||||
frame.progressive = (fileMarker === 0xFFC2);
|
||||
frame.precision = data[offset++];
|
||||
frame.scanLines = readUint16();
|
||||
@ -792,6 +794,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;
|
||||
|
1
test/pdfs/bug766138.pdf.link
Normal file
1
test/pdfs/bug766138.pdf.link
Normal file
@ -0,0 +1 @@
|
||||
http://www.minneapolismn.gov/www/groups/public/@clerk/documents/webcontent/wcms1p-094235.pdf
|
@ -1201,6 +1201,13 @@
|
||||
"rounds": 1,
|
||||
"type": "eq"
|
||||
},
|
||||
{ "id": "bug766138",
|
||||
"file": "pdfs/bug766138.pdf",
|
||||
"md5": "b171f5cf8d9834348112fba60ee54f8c",
|
||||
"link": true,
|
||||
"rounds": 1,
|
||||
"type": "eq"
|
||||
},
|
||||
{ "id": "issue2829",
|
||||
"file": "pdfs/issue2829.pdf",
|
||||
"md5": "f32b28cf8792f6ccc470446bfbb38584",
|
||||
|
Loading…
Reference in New Issue
Block a user