"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pdfbox/src/main/java/org/apache/pdfbox/filter/CCITTFaxFilter.java" between
pdfbox-2.0.23-src.zip and pdfbox-2.0.24-src.zip

About: Apache PDFBox is a Java PDF library tool that allows creation of new PDF documents, manipulation of existing documents and the ability to extract content from documents.

CCITTFaxFilter.java  (pdfbox-2.0.23-src):CCITTFaxFilter.java  (pdfbox-2.0.24-src)
skipping to change at line 140 skipping to change at line 140
int pos = 0; int pos = 0;
int read; int read;
while ((read = decoderStream.read(result, pos, result.length - pos)) > - 1) while ((read = decoderStream.read(result, pos, result.length - pos)) > - 1)
{ {
pos += read; pos += read;
if (pos >= result.length) if (pos >= result.length)
{ {
break; break;
} }
} }
decoderStream.close();
} }
private void invertBitmap(byte[] bufferData) private void invertBitmap(byte[] bufferData)
{ {
for (int i = 0, c = bufferData.length; i < c; i++) for (int i = 0, c = bufferData.length; i < c; i++)
{ {
bufferData[i] = (byte) (~bufferData[i] & 0xFF); bufferData[i] = (byte) (~bufferData[i] & 0xFF);
} }
} }
@Override @Override
protected void encode(InputStream input, OutputStream encoded, COSDictionary parameters) protected void encode(InputStream input, OutputStream encoded, COSDictionary parameters)
throws IOException throws IOException
{ {
int cols = parameters.getInt(COSName.COLUMNS); int cols = parameters.getInt(COSName.COLUMNS);
int rows = parameters.getInt(COSName.ROWS); int rows = parameters.getInt(COSName.ROWS);
CCITTFaxEncoderStream ccittFaxEncoderStream = CCITTFaxEncoderStream ccittFaxEncoderStream =
new CCITTFaxEncoderStream(encoded, cols, rows, TIFFExtension.FIL L_LEFT_TO_RIGHT); new CCITTFaxEncoderStream(encoded, cols, rows, TIFFExtension.FIL L_LEFT_TO_RIGHT);
IOUtils.copy(input, ccittFaxEncoderStream); IOUtils.copy(input, ccittFaxEncoderStream);
input.close();
} }
} }
 End of changes. 2 change blocks. 
2 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)