Skip to content

Commit 3f1bad5

Browse files
committed
Stop using optimize=True when saving Deep Zoom tiles
optimize mode is slower for PNG and reportedly significantly slower for JPEG, so the dynamic tiler shouldn't be using it. optimize mode also disables streaming encoding in libjpeg, so with sufficiently large tiles we start getting buffer overrun errors. We could expand the encode buffer (based on tile size) or enable optimization in the static tiler only for PNG, but without a clear upside we'll just disable the option. Closes #1.
1 parent 42667fc commit 3f1bad5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/deepzoom/deepzoom-server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def tile(slug, level, col, row, format):
9696
# Invalid level or coordinates
9797
abort(404)
9898
buf = StringIO()
99-
tile.save(buf, format, optimize=True, quality=75)
99+
tile.save(buf, format, quality=75)
100100
resp = make_response(buf.getvalue())
101101
resp.mimetype = 'image/%s' % format
102102
return resp

examples/deepzoom/deepzoom-tile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def run(self):
5959
dz = self._get_dz(associated)
6060
last_associated = associated
6161
tile = dz.get_tile(level, address)
62-
tile.save(outfile, optimize=True, quality=90)
62+
tile.save(outfile, quality=90)
6363
self._queue.task_done()
6464

6565
def _get_dz(self, associated=None):

0 commit comments

Comments
 (0)