Skip to content

Commit

Permalink
Merge pull request #25 from melissalinkert/pad-tile-height
Browse files Browse the repository at this point in the history
Pad tile height
  • Loading branch information
chris-allan authored May 17, 2020
2 parents e365880 + e55066c commit 5a6f939
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -709,15 +709,16 @@ private void convertPyramid(PyramidSeries s)
Slf4JStopWatch t1 = new Slf4JStopWatch("writeTile");
try {
if (tileBytes != null) {
if (region.width == descriptor.tileSizeX) {
if (region.width == descriptor.tileSizeX &&
region.height == descriptor.tileSizeY)
{
writeTile(s, currentPlane, tileBytes,
currentIndex, currentResolution);
}
else {
// pad the tile to the correct width
int paddedHeight = tileBytes.length / region.width;
// padded tile, use descriptor X and Y tile size
byte[] realTile =
new byte[descriptor.tileSizeX * paddedHeight];
new byte[descriptor.tileSizeX * descriptor.tileSizeY];
int totalRows = region.height;
int inRowLen = tileBytes.length / totalRows;
int outRowLen = realTile.length / totalRows;
Expand Down

0 comments on commit 5a6f939

Please sign in to comment.