Skip to content

Commit

Permalink
Temp removal of method code.
Browse files Browse the repository at this point in the history
  • Loading branch information
YM162 committed Dec 28, 2023
1 parent 37b711f commit b3033d1
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 31 deletions.
31 changes: 12 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gulagcleaner_python/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "gulagcleaner_python"
version = "0.11.0"
version = "0.11.1"
edition = "2021"
authors = ["YM162 <[email protected]>"]
description = "Ad removal tool for PDFs."
Expand Down
2 changes: 1 addition & 1 deletion gulagcleaner_python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "gulagcleaner"
version = "0.11.0"
version = "0.11.1"
description = "Ad removal tool for PDFs."
authors = [
{name = "YM162", email = "[email protected]"}]
Expand Down
2 changes: 1 addition & 1 deletion gulagcleaner_python/python/gulagcleaner/command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def main():

# Check for the -v argument
if arguments["version"]:
print("Current version: 0.11.0")
print("Current version: 0.11.1")
return

# Get the pdf_path argument
Expand Down
2 changes: 1 addition & 1 deletion gulagcleaner_rs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "gulagcleaner_rs"
version = "0.11.0"
version = "0.11.1"
edition = "2021"
authors = ["YM162 <[email protected]>"]
description = "Ad removal tool for PDFs."
Expand Down
1 change: 1 addition & 0 deletions gulagcleaner_rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ mod tests {
//Load some pdf bytes and clean it
let data = std::fs::read("../test.pdf").unwrap();
let (clean_pdf,_) = clean_pdf(data,0);
//Print the length of the pdf
std::fs::write("../test_clean.pdf", clean_pdf).unwrap();
}
}
6 changes: 4 additions & 2 deletions gulagcleaner_wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "gulagcleaner_wasm"
version = "0.11.0"
version = "0.11.1"
edition = "2021"
authors = ["YM162 <[email protected]>"]
description = "Ad removal tool for PDFs."
Expand All @@ -15,5 +15,7 @@ crate-type = ["cdylib"]

[dependencies]
serde = { version = "1.0", features = ["derive"] }
wasm-bindgen = { version = "0.2", features = ["serde-serialize"] }
serde-wasm-bindgen = "0.6.3"
wasm-bindgen = "0.2"

gulagcleaner_rs = { path = "../gulagcleaner_rs" }
14 changes: 8 additions & 6 deletions gulagcleaner_wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ pub struct CleaningResult {
}

#[wasm_bindgen]
pub fn clean_pdf(data: Vec<u8>,force_naive: u8) -> JsValue {
pub fn clean_pdf(data: Vec<u8>,force_naive: u8) -> Vec<u8> {
let (clean_pdf,method_code) = gulagcleaner_rs::clean_pdf(data, force_naive);
let example = CleaningResult {
result: clean_pdf,
method: method_code,
};
JsValue::from_serde(&example).unwrap()
// For some reason, the serde serialization messes up our data, so we just return the raw bytes until we find a fix
// let example = CleaningResult {
// result: clean_pdf,
// method: method_code,
// };
// Ok(serde_wasm_bindgen::to_value(&example)?)
return clean_pdf;
}

0 comments on commit b3033d1

Please sign in to comment.