Remove commented code and reformat comments
@@ -27,16 +27,11 @@ use image::{GenericImageView, imageops, ImageFormat, io::Reader};
use std::process::exit;
use wasi_types::ErrNo;
-/// Reads two input sources from the Veracruz host: the first input source is assumed to be a vector
-/// of `AdvertisementViewer` structs, whilst the second is assumed to be a vector of `Customer`
-/// structs. Fails with [`return_code::ErrorCode::BadInput`] if the number of inputs provided is
-/// not equal to 2, or if the inputs cannot be deserialized from Bincode.
-/// TODO: read image directly (stream)
-
fn process_image() -> Result<(), wasi_types::ErrNo> {
// Use the open function to load an image from a Path.
// `open` returns a `DynamicImage` on success.
- // By default, jpeg-decode reads JPEG images in parallel threads (cf. rayon), which aren't supported in WASM. The workaround is to read PNG images instead
+ // By default, jpeg-decode reads JPEG images in parallel threads (cf. rayon), which aren't
+ // supported in WASM. The workaround is to read PNG images instead
let mut img = image::open("/test.png").map_err(|_| {
println!("Failure opening /test.png");
ErrNo::Proto
@@ -49,13 +44,6 @@ fn process_image() -> Result<(), wasi_types::ErrNo> {
// Write the contents of this image to the Writer in PNG format.
subimg.to_image().save_with_format("/output", ImageFormat::Png).unwrap();
- // Verify the output
- /*
- let img = Reader::open("/output").unwrap().with_guessed_format().unwrap().decode().unwrap();
- println!("dimensions {:?}", img.dimensions());
- println!("color type: {:?}", img.color());
- */
-
Ok(())
}
