[gimp] plug-ins: Optimize OpenRaster PNG saving



commit 614714d980b906ec8ee049d1f6ea90681640c07a
Author: Jon Nordby <jononor gmail com>
Date:   Fri Mar 12 23:01:24 2010 +0100

    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.

 plug-ins/pygimp/plug-ins/file-openraster.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/plug-ins/pygimp/plug-ins/file-openraster.py b/plug-ins/pygimp/plug-ins/file-openraster.py
index 2016c2b..f4bf6e2 100755
--- a/plug-ins/pygimp/plug-ins/file-openraster.py
+++ b/plug-ins/pygimp/plug-ins/file-openraster.py
@@ -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)
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]