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 for issues 23 #37

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -213,6 +213,18 @@
</plugins>
</build>
</profile>

<profile>
<!-- to disable javadoc warnings -->
<id>disable-java8-doclint</id>
<activation>
<jdk>[1.8,)</jdk>
</activation>
<properties>
<doclint>none</doclint>
</properties>
</profile>

</profiles>

<dependencies>
Original file line number Diff line number Diff line change
@@ -712,9 +712,7 @@ class. With initTile() however the tiles could be read in random
for (int tIdx=0; tIdx<nt; tIdx++) {
baknBytes[tIdx] = nBytes[tIdx];
if(printInfo) {
FacilityManager.getMsgLogger().
println(""+hi.toStringTileHeader(tIdx,tilePartLen[tIdx].
length),2,2);
FacilityManager.getMsgLogger().println(""+hi.toStringTileHeader(tIdx,tilePartLen[tIdx].length),2,2);
}
}
}
@@ -756,6 +754,12 @@ private void allocateRate() throws IOException {
* @return The tile number of the tile part that was read
* */
private int readTilePartHeader() throws IOException{
if (in.getPos() == in.length()) {
// This block is needed when we add one to the number of
// tile parts - see line 811.
isEOCFound = true; // Not strictly true.
return -1;
}
HeaderInfo.SOT ms = hi.getNewSOT();

// SOT marker
@@ -804,6 +808,11 @@ private int readTilePartHeader() throws IOException{
// TNsot
int nrOfTileParts = in.read();
ms.tnsot = nrOfTileParts;
// SPEC DEVIATION: Spec declares TNsot as "Number of tile-parts of a tile in the codestream",
// but many images seem to treat this value as "Maximum number of tile parts", i.e. one more.
// Reading less tiles than expected is handled, so we can safely increase this value by
// one for images.
nrOfTileParts++;
hi.sot.put("t"+tile+"_tp"+tilePart,ms);
if(nrOfTileParts==0) { // The number of tile-part is not specified in
// this tile-part header.