Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewprivate authored Oct 25, 2024
1 parent e7cf2b0 commit 98d2294
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ body {
display: flex;
opacity: 1;
border: 2px solid rgba(0, 0, 255, 0.25);
user-select: none;
}

.web-stitch .stitch-visualizer .image-container .interactive-tile .tile-label {
Expand Down
7 changes: 4 additions & 3 deletions src/modules/utif.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3074,7 +3074,7 @@ let utiftemp;;
if (i == 0) return;
continue;
}
if (prm.debug) log(" ".repeat(depth), tag, type, UTIF.tags[tag], arr);
// console.log(" ".repeat(depth), tag, type, arr.length);

ifd["t" + tag] = arr;

Expand Down Expand Up @@ -3555,6 +3555,7 @@ let utiftemp;;
area = w * h,
data = out.data;
var img = new Uint8Array(area);
// console.log(img)
//console.log(out);
// 0: WhiteIsZero, 1: BlackIsZero, 2: RGB, 3: Palette color, 4: Transparency mask, 5: CMYK
var intp = (out["t262"] ? out["t262"][0] : 2),
Expand All @@ -3566,7 +3567,7 @@ let utiftemp;;
if (intp == 1 && bps == 32 && sfmt != 3) throw "e"; // sample format
var bpl = Math.ceil(smpls * bps * w / 8);

//log("interpretation: ", intp, "smpls", smpls, "bps", bps, "sample format",sfmt, out);
//console.log("interpretation: ", intp, "smpls", smpls, "bps", bps, "sample format",sfmt, out);

if (false) { } else if (intp == 0) {
scl = 1 / 256; // "Photopeatest.tif"
Expand Down Expand Up @@ -3644,7 +3645,7 @@ let utiftemp;;
var qi = (io + i),
o = (off >>> 2) + i,
px = f32[o];
img[qi] = ~~(0.5 + 255 * px);
img[qi] = ~~(px);

}
}
Expand Down
7 changes: 4 additions & 3 deletions src/ui/StitchVisualizer.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class StitchVisualizer {
getCurrentSliceForImage(imageIndex) {
const bounds = this.getFrameBounds();
const offset = this.getOffsetForImage(imageIndex);
return this.currentSliceFromMiddle + Math.floor(bounds.depth / 2) - bounds.minZ - offset.z
return this.currentSliceFromMiddle + (Math.floor(bounds.depth / 2) + bounds.minZ)- offset.z;
}

getSliceBounds() {
Expand Down Expand Up @@ -746,8 +746,9 @@ export class StitchVisualizer {

updateSliceSlider() {
const bounds = this.getSliceBounds();
this.ui.sliceSlider.min = bounds.min;
this.ui.sliceSlider.max = bounds.max;
let half = Math.floor(bounds.max - bounds.min) / 2;
this.ui.sliceSlider.min = -half;
this.ui.sliceSlider.max = bounds.max - bounds.min - half;
this.ui.sliceSlider.value = this.currentSliceFromMiddle;
}

Expand Down

0 comments on commit 98d2294

Please sign in to comment.