From cb29fdbc827237a91ebffae902ee7b01fa8b4f8f Mon Sep 17 00:00:00 2001
From: Joel Grunbaum <joelgrun@gmail.com>
Date: Mon, 07 Dec 2020 07:30:09 +0000
Subject: [PATCH] Added resizing

---
 README.org               |    2 +-
 reddit-wallpaper-fetcher |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/README.org b/README.org
index 23ec7ad..92160fe 100644
--- a/README.org
+++ b/README.org
@@ -13,4 +13,4 @@
 
 * TODOs
 - Interface with the window manager to set the wallpaper
-- Setup image scaling/resizing
+# - Setup image scaling/resizing
diff --git a/reddit-wallpaper-fetcher b/reddit-wallpaper-fetcher
index 8e52523..50fc359 100755
--- a/reddit-wallpaper-fetcher
+++ b/reddit-wallpaper-fetcher
@@ -61,9 +61,9 @@
 echo https://reddit.com$(echo $LATEST | jq ".data.children[-1].data.permalink" | sed 's/"//g') >> $WALLDIR/data.txt
 
 #Add image title
+convert "$WALLDIR/temp.$ext" -crop "$SIZE+0+0" -resize "$SIZE!" "$WALLDIR/wallpaper.jpg"
+rm "$WALLDIR/temp.$ext"
+
 if [ $WRITE_TITLE == 1 ]; then
-    convert "$WALLDIR/temp.$ext" -fill "$TITLE_COLOR" -gravity "$TITLE_POSITION" -pointsize "$TITLE_SIZE" -annotate 0 "$title" "$WALLDIR/wallpaper.jpg"
-else
-    convert "$WALLDIR/temp.$ext" "$WALLDIR/wallpaper.jpg"
+    convert "$WALLDIR/wallpaper.jpg" -fill "$TITLE_COLOR" -gravity "$TITLE_POSITION" -pointsize "$TITLE_SIZE" -annotate 0 "$title" "$WALLDIR/wallpaper.jpg"
 fi
-rm $WALLDIR/temp.$ext

--
Gitblit v1.10.0