@@ -107,7 +107,7 @@ def channelGen():
107
107
tile = pixels .getTile (* tileInfo )
108
108
tile_min = min (tile_min , amin (tile ))
109
109
tile_max = max (tile_max , amax (tile ))
110
- byte_count += len ( tile )
110
+ byte_count += tile . nbytes
111
111
tile_count += 1
112
112
rv [c ] = (tile_min , tile_max )
113
113
yield rv , byte_count , tile_count
@@ -116,7 +116,8 @@ def channelGen():
116
116
for x , byte_count , tile_count in channelGen ():
117
117
statsInfos .update (x )
118
118
119
- print "Loaded %s tile(s) (%s bytes)" % (tile_count , byte_count )
119
+ if debug :
120
+ print "Loaded %s tile(s) (%s bytes)" % (tile_count , byte_count )
120
121
return statsInfos
121
122
122
123
@@ -156,7 +157,7 @@ def processImages(conn, scriptParams):
156
157
c_max = globalmax [c ]
157
158
tb .row ("Total: outer " , c , min (c_min ), max (c_max ))
158
159
tb .row ("Total: inner " , c , max (c_min ), min (c_max ))
159
- tb .row ("Total: average" , c , avg (c_min ), avg (c_max ))
160
+ tb .row ("Total: average" , c , int ( avg (c_min )), int ( avg (c_max ) ))
160
161
161
162
if scriptParams ["DryRun" ]:
162
163
print str (tb .build ())
@@ -188,8 +189,9 @@ def processImages(conn, scriptParams):
188
189
else :
189
190
raise Exception ("unknown combine: %s" % combine )
190
191
191
- print "Image:%s(c=%s) - %s StatsInfo(%s, %s)" % (
192
- iId , c , action , si .globalMin .val , si .globalMax .val )
192
+ if debug :
193
+ print "Image:%s(c=%s) - %s StatsInfo(%s, %s)" % (
194
+ iId , c , action , si .globalMin .val , si .globalMax .val )
193
195
ch ._obj .statsInfo = si
194
196
ch .save ()
195
197
0 commit comments