From ad38acaff3d8dbbe37f683dc70a3edf8307485f5 Mon Sep 17 00:00:00 2001 From: Paul Warren Date: Tue, 30 Jul 2019 20:40:11 +1000 Subject: [PATCH] Cleanup from master merge --- .gitignore | 19 +------------------ Cargo.toml | 11 ----------- README.md | 4 +++- src/main.rs | 49 ------------------------------------------------- src/tests.rs | 15 --------------- 5 files changed, 4 insertions(+), 94 deletions(-) delete mode 100644 Cargo.toml delete mode 100644 src/main.rs delete mode 100644 src/tests.rs diff --git a/.gitignore b/.gitignore index 154e80c..0d20b64 100644 --- a/.gitignore +++ b/.gitignore @@ -1,18 +1 @@ -# Generated by Cargo -# will have compiled files and executables -/target/ - -# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries -# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html -Cargo.lock - -# These are backup files generated by rustfmt -**/*.rs.bk - - -#Added by cargo -# -#already existing elements are commented out - -/target -#**/*.rs.bk +*.pyc diff --git a/Cargo.toml b/Cargo.toml deleted file mode 100644 index 612557f..0000000 --- a/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "desteg" -version = "0.1.0" -authors = ["pwarren"] -edition = "2018" - -[dependencies] -rocket="0.4.*" -image="*" -tempfile="3.*" - diff --git a/README.md b/README.md index 042d819..906fe1a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # desteg -A sily web API to add entropy to images in an attempt to destroy any steganography +A silly web API to add entropy to images in an attempt to destroy any steganography + + curl -H "Content-Type: application/png" --data-binary @GPSPeedo1.png http://localhost:5002/desteg -o GPSPeedo1_Destegged.png diff --git a/src/main.rs b/src/main.rs deleted file mode 100644 index fcfe2a0..0000000 --- a/src/main.rs +++ /dev/null @@ -1,49 +0,0 @@ -#![feature(proc_macro_hygiene, decl_macro)] - -#[macro_use] extern crate rocket; - -//extern crate rand; - -extern crate image; -//extern crate tempfile; - -//use std::io; - -use rocket::Data; -use rocket::response::content; - -#[cfg(test)] mod tests; - -#[get("/")] -fn index() -> &'static str { - " - Usage - - POST / - - accepts image data in the body of the requests, returns the - image with more entropy added to the least significant bits of each - colour channel. - - EXMAPLE: curl --data-binary @file.jpg http://localhost:8000 -" -} - -#[post("/", data = "")] -fn desteg(incoming_image: Data) -> image::DynamicImage { - - let image_buffer = image::load_from_memory(incoming_image.peek()).unwrap(); - - image_buffer -} - -fn rocket() -> rocket::Rocket { - let my_rocket = rocket::ignite().mount("/", routes![index]); - my_rocket -} - -fn main() { - rocket().launch(); -} - - diff --git a/src/tests.rs b/src/tests.rs deleted file mode 100644 index ef48625..0000000 --- a/src/tests.rs +++ /dev/null @@ -1,15 +0,0 @@ -use super::rocket; -use rocket::local::Client; -use rocket::http::{Status, ContentType}; - -#[test] -fn check_index() { - let client = Client::new(rocket()).unwrap(); - - // Ensure the index returns what we expect. - let response = client.get("/").dispatch(); - assert_eq!(response.status(), Status::Ok); - assert_eq!(response.content_type(), Some(ContentType::Plain)); -} - -