Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r84469 - in trunk/boost/gil/extension/io: . formats/png
From: chhenning_at_[hidden]
Date: 2013-05-24 19:54:03


Author: chhenning
Date: 2013-05-24 19:54:02 EDT (Fri, 24 May 2013)
New Revision: 84469
URL: http://svn.boost.org/trac/boost/changeset/84469

Log:
bug fix relating to png's compression settings.
Text files modified:
   trunk/boost/gil/extension/io/formats/png/writer_backend.hpp | 2 +-
   trunk/boost/gil/extension/io/png_tags.hpp | 18 +++++++++++++-----
   2 files changed, 14 insertions(+), 6 deletions(-)

Modified: trunk/boost/gil/extension/io/formats/png/writer_backend.hpp
==============================================================================
--- trunk/boost/gil/extension/io/formats/png/writer_backend.hpp (original)
+++ trunk/boost/gil/extension/io/formats/png/writer_backend.hpp 2013-05-24 19:54:02 EDT (Fri, 24 May 2013)
@@ -132,7 +132,7 @@
                     , static_cast< png_bitdepth::type >( png_rw_info_t::_bit_depth )
                     , static_cast< png_color_type::type >( png_rw_info_t::_color_type )
                     , _info._interlace_method
- , _info._compression_method
+ , _info._compression_type
                     , _info._filter_method
                     );
 

Modified: trunk/boost/gil/extension/io/png_tags.hpp
==============================================================================
--- trunk/boost/gil/extension/io/png_tags.hpp (original)
+++ trunk/boost/gil/extension/io/png_tags.hpp 2013-05-24 19:54:02 EDT (Fri, 24 May 2013)
@@ -192,16 +192,22 @@
 // Write properties
 ////////////////////////
 
+// relates to info_ptr->compression_type
+struct png_compression_type : property_base< png_byte >
+{
+ static const type default_value = PNG_COMPRESSION_TYPE_BASE;
+};
+
 // compression level - default values taken from libpng manual.
 // Look for png_set_compression_level
 struct png_compression_level : property_base< int >
 {
- static const type default_value = Z_BEST_COMPRESSION;
+ static const type default_value = 3;
 };
 
 struct png_compression_mem_level : property_base< int >
 {
- static const type default_value = 8;
+ static const type default_value = MAX_MEM_LEVEL;
 };
 
 struct png_compression_strategy : property_base< int >
@@ -211,7 +217,7 @@
 
 struct png_compression_window_bits : property_base< int >
 {
- static const type default_value = 15;
+ static const type default_value = 9;
 };
 
 struct png_compression_method : property_base< int >
@@ -735,7 +741,8 @@
 template<>
 struct image_write_info< png_tag > : public png_info_base
 {
- image_write_info( const png_compression_level::type compression_level = png_compression_level::default_value
+ image_write_info( const png_compression_type::type compression_type = png_compression_type::default_value
+ , const png_compression_level::type compression_level = png_compression_level::default_value
                     , const png_compression_mem_level::type compression_mem_level = png_compression_mem_level::default_value
                     , const png_compression_strategy::type compression_strategy = png_compression_strategy::default_value
                     , const png_compression_window_bits::type compression_window_bits = png_compression_window_bits::default_value
@@ -751,6 +758,7 @@
                     , const png_swap_alpha::type swap_alpha = png_swap_alpha::default_value
                     )
     : png_info_base()
+ , _compression_type( compression_type )
     , _compression_level( compression_level )
     , _compression_mem_level( compression_mem_level )
     , _compression_strategy( compression_strategy )
@@ -781,8 +789,8 @@
     , _swap_alpha( swap_alpha )
     {}
 
-
     // compression stuff
+ png_compression_type::type _compression_type;
     png_compression_level::type _compression_level;
     png_compression_mem_level::type _compression_mem_level;
     png_compression_strategy::type _compression_strategy;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk