Mercurial > cgi-bin > hgweb.cgi > TopoTiler
comparison make-tile @ 11:6e4a8ddacf61
Fix very minor bug.
author | David Barts <n5jrn@me.com> |
---|---|
date | Thu, 26 Aug 2021 13:50:18 -0700 |
parents | 1944acce0e6f |
children | 698b3335a63d |
comparison
equal
deleted
inserted
replaced
10:1944acce0e6f | 11:6e4a8ddacf61 |
---|---|
114 Find an edge in an image with a white border. | 114 Find an edge in an image with a white border. |
115 """ | 115 """ |
116 if orientation == Orientation.VERTICAL: | 116 if orientation == Orientation.VERTICAL: |
117 what = "column" | 117 what = "column" |
118 strip = Column | 118 strip = Column |
119 maxn = image.width - 1 | 119 maxn = image.width |
120 else: | 120 else: |
121 what = "row" | 121 what = "row" |
122 strip = Row | 122 strip = Row |
123 maxn = image.height - 1 | 123 maxn = image.height |
124 # Establish outer bound and sanity-check it. | 124 # Establish outer bound and sanity-check it. |
125 outer = 0 if direction == Direction.ASCENDING else maxn | 125 outer = 0 if direction == Direction.ASCENDING else maxn - 1 |
126 if not strip(image, outer).is_all_white(): | 126 if not strip(image, outer).is_all_white(): |
127 raise TopoTilerException("Unexpected nonwhite edge ({0} = {1})!".format(what, outer)) | 127 raise TopoTilerException("Unexpected nonwhite edge ({0} = {1})!".format(what, outer)) |
128 # Establish inner bound and sanity-check it. | 128 # Establish inner bound and sanity-check it. |
129 inner = outer + direction * maxn // 4 | 129 inner = outer + direction * maxn // 4 |
130 if strip(image, inner).is_all_white(): | 130 if strip(image, inner).is_all_white(): |