@@ -1,8 +1,7 | |||||
1 | begin |
|
1 | begin | |
2 | require 'zlib' |
|
2 | require 'zlib' | |
3 | @@__have_zlib = true |
|
|||
4 | rescue |
|
3 | rescue | |
5 | @@__have_zlib = false |
|
4 | # Zlib not available | |
6 | end |
|
5 | end | |
7 |
|
6 | |||
8 | require 'rexml/document' |
|
7 | require 'rexml/document' | |
@@ -211,7 +210,7 module SVG | |||||
211 | @doc.write( data, 0 ) |
|
210 | @doc.write( data, 0 ) | |
212 |
|
211 | |||
213 | if @config[:compress] |
|
212 | if @config[:compress] | |
214 | if @@__have_zlib |
|
213 | if Object.const_defined?(:Zlib) | |
215 | inp, out = IO.pipe |
|
214 | inp, out = IO.pipe | |
216 | gz = Zlib::GzipWriter.new( out ) |
|
215 | gz = Zlib::GzipWriter.new( out ) | |
217 | gz.write data |
|
216 | gz.write data |
General Comments 0
You need to be logged in to leave comments.
Login now