plug-ins: Optimize OpenRaster PNG saving

Sets lower compression and disables interlacing.
On a 5 layer image of 4500x6000px this gives an order of magnitude better
save-times, with 50% increase in file size.
This commit is contained in:
Jon Nordby 2010-03-12 23:01:24 +01:00 committed by Martin Nordholts
parent 3352b0485c
commit 614714d980
1 changed files with 4 additions and 1 deletions

View File

@ -85,7 +85,10 @@ def save_ora(img, drawable, filename, raw_filename):
def store_layer(img, drawable, path):
tmp = os.path.join(tempdir, 'tmp.png')
pdb['file-png-save-defaults'](img, drawable, tmp, 'tmp.png')
interlace, compression = 0, 2
png_chunks = (1, 1, 1, 1, 1) # write all PNG chunks
pdb['file-png-save'](img, drawable, tmp, 'tmp.png',
interlace, compression, *png_chunks)
orafile.write(tmp, path)
os.remove(tmp)