Skip to content

Commit

Permalink
Save top left coordinates when exporting DZI
Browse files Browse the repository at this point in the history
  • Loading branch information
Dadido3 committed Feb 4, 2024
1 parent 93a1283 commit 45df692
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bin/stitch/dzi.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ func (d DZI) ExportDZIDescriptor(outputPath string) error {
Width string
Height string
}
TopLeft struct {
X string
Y string
}
}
}

Expand All @@ -87,6 +91,8 @@ func (d DZI) ExportDZIDescriptor(outputPath string) error {
dziDescriptor.Image.TileSize = strconv.Itoa(d.tileSize)
dziDescriptor.Image.Size.Width = strconv.Itoa(d.stitchedImage.bounds.Dx())
dziDescriptor.Image.Size.Height = strconv.Itoa(d.stitchedImage.bounds.Dy())
dziDescriptor.Image.TopLeft.X = strconv.Itoa(d.stitchedImage.bounds.Min.X)
dziDescriptor.Image.TopLeft.Y = strconv.Itoa(d.stitchedImage.bounds.Min.Y)

jsonEnc := json.NewEncoder(f)
return jsonEnc.Encode(dziDescriptor)
Expand Down

0 comments on commit 45df692

Please sign in to comment.