Skip to content

Instantly share code, notes, and snippets.

@wehlutyk
Created July 2, 2018 13:16
Show Gist options
  • Save wehlutyk/eafd275f4b41739010dc30f9c08a9e08 to your computer and use it in GitHub Desktop.
Save wehlutyk/eafd275f4b41739010dc30f9c08a9e08 to your computer and use it in GitHub Desktop.
diff --git a/Cargo.toml b/Cargo.toml
index 47a50fd..5f00177 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,11 +12,15 @@ description = "A Rust library for PDF document manipulation."
[dependencies]
pom = "1.0.1"
chrono = "0.3.0"
-flate2 = "0.2.14"
+flate2 = { path = "../flate2-rs" , default-features = false }
linked-hash-map = "0.3.0"
dtoa = "0.4.1"
itoa = "0.3.1"
encoding = "0.2"
+[features]
+default = ["flate2/miniz-sys"]
+rust_backend = ["flate2/rust_backend"]
+
[badges]
travis-ci = { repository = "J-F-Liu/lopdf" }
diff --git a/src/object.rs b/src/object.rs
index 42b05a0..fd1f5fc 100644
--- a/src/object.rs
+++ b/src/object.rs
@@ -385,7 +385,7 @@ impl Stream {
use std::io::prelude::*;
if self.dict.get("Filter").is_none() {
- let mut encoder = ZlibEncoder::new(Vec::new(), Compression::Best);
+ let mut encoder = ZlibEncoder::new(Vec::new(), Compression::best());
encoder.write(self.content.as_slice()).unwrap();
let compressed = encoder.finish().unwrap();
if compressed.len() + 19 < self.content.len() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment