Skip to content

Commit eeac397

Browse files
committed
[RELEASE] iText 7 pdfSweep - 2.0.4
https://github.com/itext/i7j-pdfsweep/releases/tag/2.0.4 * release/2.0.4: [RELEASE] 2.0.4-SNAPSHOT -> 2.0.4 Implement image masks filtering Handle noninvertible transformation matricies. Add some tests. Make use of SystemUtil#getTimeBasedIntSeed() method for Random instance creation Improve contribution guidelines Remove unused imports and add @category for tests [RELEASE] 2.0.3-SNAPSHOT -> 2.0.4-SNAPSHOT
2 parents 2b64b04 + 3b2a883 commit eeac397

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+694
-218
lines changed

CONTRIBUTING.md

Lines changed: 11 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -70,83 +70,29 @@ Before you submit your pull request consider the following guidelines:
7070
* Please sign the [iText Contributor License Agreement (iCLA)](#cla) before sending pull
7171
requests for any change of more than 20 significant lines of code (we're not counting curly braces and other syntactical sugar).
7272
We cannot accept code without this agreement.
73-
* Clone **iText 7 Community** to your local machine.
74-
75-
```shell
76-
git clone [email protected]:itext/itext7.git
77-
cd itext7
78-
git fetch origin
79-
git checkout -b develop origin/develop
80-
```
81-
82-
* Make your changes in a new git branch based off the develop branch:
83-
84-
```shell
85-
git checkout -b my-fix-branch develop
86-
```
87-
88-
* Create your patch, **including appropriate test cases**.
73+
* Fork the iText repository on GitHub.
74+
* Clone your iText fork to your local machine.
75+
* Make your changes, **including appropriate test cases**.
8976
* Follow our [Coding Rules](#rules).
90-
* Run the full **iText 7 Community** test suite and ensure that all tests pass.
9177
* Commit your changes using a descriptive commit message that follows our
9278
[commit message conventions](#commit-message-format).
93-
94-
```shell
95-
git commit -a
96-
```
97-
Note: the optional commit `-a` command line option will automatically `add` and `rm` edited files.
98-
9979
* Now would be a good time to fix up your commits (if you want or need to) with `git rebase --interactive`.
10080
* Build your changes locally to ensure all the tests pass.
101-
* Push your branch to your GitHub account:
102-
103-
```shell
104-
git remote add my-remote [email protected]:my-remote/itext7.git
105-
git push my-remote my-fix-branch
106-
```
107-
108-
* In GitHub, send a pull request to `itext7:develop`.
81+
* Push your changes to your GitHub account.
82+
* Create a pull request in GitHub.
83+
"Head fork" should be your repository, and the "base fork" should be the iText7 official repository.
10984
* If we suggest changes then:
11085
* Make the required updates.
111-
* Re-run the **iText 7 Community** test suite to ensure tests are still passing.
112-
* Rebase your branch and force push to your GitHub repository (this will update your Pull Request):
113-
114-
```shell
115-
git fetch origin
116-
git rebase develop -i
117-
git push my-remote my-fix-branch -f
118-
```
86+
* Fix up your commits if needed, with an interactive rebase.
87+
* Re-run the tests and make sure that they are still passing.
88+
* Force push to your GitHub repository. This will update your Pull Request.
11989

12090
That's it! Thank you for your contribution!
12191

12292
#### After your pull request is merged
12393

124-
After your pull request is merged, you can safely delete your branch and pull the changes
125-
from the main (upstream) repository:
126-
127-
* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
128-
129-
```shell
130-
git push my-remote --delete my-fix-branch
131-
```
132-
133-
* Check out the develop branch:
134-
135-
```shell
136-
git checkout develop -f
137-
```
138-
139-
* Delete the local branch:
140-
141-
```shell
142-
git branch -D my-fix-branch
143-
```
144-
145-
* Update your develop with the latest upstream version:
146-
147-
```shell
148-
git pull --ff upstream develop
149-
```
94+
After your pull request is merged, you can safely delete your fork and pull the changes
95+
from the main (upstream) repository.
15096

15197

15298
## <a name="rules">Coding Rules</a>

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
<parent>
55
<groupId>com.itextpdf</groupId>
66
<artifactId>root</artifactId>
7-
<version>7.1.5</version>
7+
<version>7.1.6</version>
88
<relativePath/>
99
</parent>
1010
<artifactId>cleanup</artifactId>
11-
<version>2.0.3</version>
11+
<version>2.0.4</version>
1212
<name>pdfSweep</name>
1313
<url>http://itextpdf.com/</url>
1414
<properties>

src/main/java/com/itextpdf/pdfcleanup/FilteredImagesCache.java

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,8 @@ This file is part of the iText (R) project.
4646
import com.itextpdf.kernel.pdf.PdfDocument;
4747
import com.itextpdf.kernel.pdf.PdfIndirectReference;
4848
import com.itextpdf.kernel.pdf.PdfStream;
49-
import com.itextpdf.kernel.pdf.canvas.parser.data.ImageRenderInfo;
5049
import com.itextpdf.kernel.pdf.xobject.PdfImageXObject;
5150
import java.util.ArrayList;
52-
import java.util.Collections;
53-
import java.util.Comparator;
5451
import java.util.HashMap;
5552
import java.util.LinkedHashSet;
5653
import java.util.List;
@@ -60,8 +57,8 @@ This file is part of the iText (R) project.
6057
class FilteredImagesCache {
6158
private Map<PdfIndirectReference, List<FilteredImageKey>> cache = new HashMap<>();
6259

63-
static FilteredImageKey createFilteredImageKey(ImageRenderInfo image, List<Rectangle> areasToBeCleaned, PdfDocument document) {
64-
PdfStream imagePdfObject = image.getImage().getPdfObject();
60+
static FilteredImageKey createFilteredImageKey(PdfImageXObject image, List<Rectangle> areasToBeCleaned, PdfDocument document) {
61+
PdfStream imagePdfObject = image.getPdfObject();
6562
if (imagePdfObject.getIndirectReference() == null) {
6663
imagePdfObject.makeIndirect(document);
6764
}
@@ -125,25 +122,25 @@ private boolean rectanglesEqualWithEps(List<Rectangle> cacheRects, List<Rectangl
125122
}
126123

127124
static class FilteredImageKey {
128-
private ImageRenderInfo image;
125+
private PdfImageXObject image;
129126
private List<Rectangle> cleanedAreas;
130127
private PdfImageXObject filteredImage;
131128

132-
FilteredImageKey(ImageRenderInfo imageInfo, List<Rectangle> cleanedAreas) {
133-
this.image = imageInfo;
129+
FilteredImageKey(PdfImageXObject image, List<Rectangle> cleanedAreas) {
130+
this.image = image;
134131
this.cleanedAreas = cleanedAreas;
135132
}
136133

137134
List<Rectangle> getCleanedAreas() {
138135
return cleanedAreas;
139136
}
140137

141-
ImageRenderInfo getImageRenderInfo() {
138+
PdfImageXObject getImageXObject() {
142139
return image;
143140
}
144141

145142
PdfIndirectReference getImageIndRef() {
146-
return image.getImage().getPdfObject().getIndirectReference();
143+
return image.getPdfObject().getIndirectReference();
147144
}
148145

149146
PdfImageXObject getFilteredImage() {

0 commit comments

Comments
 (0)