about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGenny <gen@nyble.dev>2023-02-09 19:25:29 -0600
committerGenny <gen@nyble.dev>2023-02-09 19:25:29 -0600
commit45be9439fe9296e44d37551b6f2e1edf46c6faee (patch)
treed0d6d842925efe2dfdba1e1b7044aa32ab64f778
parent4cf9e9987284d2806592dbdbdd1df5095c990d12 (diff)
downloadgifed-45be9439fe9296e44d37551b6f2e1edf46c6faee.tar.gz
gifed-45be9439fe9296e44d37551b6f2e1edf46c6faee.zip
add width/height functions to reader; close #10
-rw-r--r--gifed/src/reader/mod.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/gifed/src/reader/mod.rs b/gifed/src/reader/mod.rs
index d81961c..b1bcc32 100644
--- a/gifed/src/reader/mod.rs
+++ b/gifed/src/reader/mod.rs
@@ -109,6 +109,14 @@ pub struct Reader<R: Read> {
 }
 
 impl<R: Read> Reader<R> {
+	pub fn width(&self) -> u16 {
+		self.screen_descriptor.width
+	}
+
+	pub fn height(&self) -> u16 {
+		self.screen_descriptor.height
+	}
+
 	pub fn block(&mut self) -> Result<Option<ReadBlock>, DecodeError> {
 		if self.saw_trailer {
 			return Ok(None);