about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgennyble <gen@nyble.dev>2023-07-18 01:47:10 -0500
committergennyble <gen@nyble.dev>2023-07-18 01:47:10 -0500
commit7bb866f0aa07e56013db68d7a50eb2cf0494960f (patch)
tree97df83ff4088542a26f8bb71f7d68ce405e480d7
parentedc9eb5b037001bc249b570fc1aa6552529a40fa (diff)
downloadgifed-7bb866f0aa07e56013db68d7a50eb2cf0494960f.tar.gz
gifed-7bb866f0aa07e56013db68d7a50eb2cf0494960f.zip
uh, they were here. these files
-rw-r--r--Cargo.toml3
-rw-r--r--README.md9
-rw-r--r--infohazard/Cargo.toml9
-rw-r--r--infohazard/src/main.rs51
4 files changed, 71 insertions, 1 deletions
diff --git a/Cargo.toml b/Cargo.toml
index f45abd6..d1cd5fb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,5 +3,6 @@ members = [
 	"gifed",
 	"gifprobe",
 	"gaudio",
-	"slugs"
+	"slugs",
+	"infohazard"
 ]
\ No newline at end of file
diff --git a/README.md b/README.md
index b950a69..f2b7fa9 100644
--- a/README.md
+++ b/README.md
@@ -44,5 +44,14 @@ Similar to FFMPEG's ffprobe, gifprobe will print details of a gif to stdout.
 ## gaudio
 Nothing valued is here. Inject/Retrieve MP3 files from GiFs. I'd like to eventually play them right outta the thing, right, but that's a lot harder.
 
+## TODO: theft
+gif tool for weird gif things.  
+just the place i put things  
+that have nowhere else to go  
+so i stop making so many  
+weird little projects here
+
+eventually i think it will absorb gaudio
+
 # License
 gifed, gifprobe, and gaudio are licensed under Creative Commons Zero 1.0; they're in the public domain. Attribution is appreciated, but not required.
diff --git a/infohazard/Cargo.toml b/infohazard/Cargo.toml
new file mode 100644
index 0000000..bc3e269
--- /dev/null
+++ b/infohazard/Cargo.toml
@@ -0,0 +1,9 @@
+[package]
+name = "infohazard"
+version = "0.1.0"
+edition = "2021"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+gifed = { path = "../gifed" }
\ No newline at end of file
diff --git a/infohazard/src/main.rs b/infohazard/src/main.rs
new file mode 100644
index 0000000..8ed6c8f
--- /dev/null
+++ b/infohazard/src/main.rs
@@ -0,0 +1,51 @@
+use std::fs::File;
+
+use gifed::{
+	block::{LoopCount, Palette},
+	writer::{GifBuilder, ImageBuilder, Writer},
+};
+
+fn main() {
+	let black = vec![0; 35];
+	let red = vec![1; 35];
+
+	let mut horiz = black.clone();
+	for _ in 0..(34 / 2) {
+		horiz.extend(&red);
+		horiz.extend(&black);
+	}
+
+	let mut row = vec![0];
+	row.extend([2, 0].repeat(34 / 2));
+
+	let vert = row.repeat(35);
+
+	let file = File::create("infohazard.gif").unwrap();
+	let mut writer = Writer::new(
+		file,
+		35,
+		35,
+		Some(Palette::try_from([0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0].as_slice()).unwrap()),
+	)
+	.unwrap();
+
+	writer.repeat(LoopCount::Forever).unwrap();
+	writer
+		.image(ImageBuilder::new(35, 35).delay(16).build(horiz).unwrap())
+		.unwrap();
+	writer
+		.image(ImageBuilder::new(35, 35).delay(16).build(vert).unwrap())
+		.unwrap();
+	writer.done().unwrap();
+
+	/*
+	GifBuilder::new(35, 35)
+		.palette(Palette::try_from([0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0].as_slice()).unwrap())
+		.repeat(LoopCount::Forever)
+		.image(ImageBuilder::new(35, 35).delay(16).build(horiz).unwrap())
+		.image(ImageBuilder::new(35, 35).delay(16).build(vert).unwrap())
+		.build()
+		.unwrap()
+		.save("infohazard.gif")
+		.unwrap()*/
+}