aboutsummaryrefslogtreecommitdiff
path: root/cmd/thumber
diff options
context:
space:
mode:
authorXe <me@christine.website>2022-12-30 15:31:44 -0500
committerXe <me@christine.website>2022-12-30 15:31:44 -0500
commit45ddea9aca135f522dde57a62bf58c563f8bdf94 (patch)
treee2ef8d07edf0a6e2b5dabc020154d342947eebf6 /cmd/thumber
parent6a0ed693247e268322d34fad3aa793e16071a7d2 (diff)
downloadx-45ddea9aca135f522dde57a62bf58c563f8bdf94.tar.xz
x-45ddea9aca135f522dde57a62bf58c563f8bdf94.zip
remove deprecated code
Signed-off-by: Xe <me@christine.website>
Diffstat (limited to 'cmd/thumber')
-rw-r--r--cmd/thumber/in/XjScp8a.pngbin292689 -> 0 bytes
-rw-r--r--cmd/thumber/in/lB4ICS3.pngbin369886 -> 0 bytes
-rw-r--r--cmd/thumber/in/oaw79y9.jpgbin67119 -> 0 bytes
-rw-r--r--cmd/thumber/main.go58
4 files changed, 0 insertions, 58 deletions
diff --git a/cmd/thumber/in/XjScp8a.png b/cmd/thumber/in/XjScp8a.png
deleted file mode 100644
index a9ec6df..0000000
--- a/cmd/thumber/in/XjScp8a.png
+++ /dev/null
Binary files differ
diff --git a/cmd/thumber/in/lB4ICS3.png b/cmd/thumber/in/lB4ICS3.png
deleted file mode 100644
index 850bf28..0000000
--- a/cmd/thumber/in/lB4ICS3.png
+++ /dev/null
Binary files differ
diff --git a/cmd/thumber/in/oaw79y9.jpg b/cmd/thumber/in/oaw79y9.jpg
deleted file mode 100644
index 2ab4cb9..0000000
--- a/cmd/thumber/in/oaw79y9.jpg
+++ /dev/null
Binary files differ
diff --git a/cmd/thumber/main.go b/cmd/thumber/main.go
deleted file mode 100644
index bd67130..0000000
--- a/cmd/thumber/main.go
+++ /dev/null
@@ -1,58 +0,0 @@
-// Command thumber creates 256x256 thumbnails for a folder/pile of them.
-package main
-
-import (
- "flag"
- "log"
- "os"
- "path/filepath"
- "strings"
-
- "github.com/disintegration/imaging"
- "within.website/x/internal"
-)
-
-var (
- dirToWalk = flag.String("walkdir", "./in", "directory to walk and generate thumbnails for")
-)
-
-func main() {
- internal.HandleStartup()
-
- err := filepath.Walk(*dirToWalk, makeThumbnail)
- if err != nil {
- log.Fatal(err)
- }
-}
-
-func makeThumbnail(fname string, info os.FileInfo, err error) error {
- if info.IsDir() {
- return nil
- }
-
- if strings.HasSuffix(fname, ".thumb.png") {
- return nil
- }
-
- if strings.HasSuffix(fname, ".html") {
- return nil
- }
-
- _, err = os.Stat("thumbs/" + filepath.Base(fname) + ".thumb.png")
- if err == nil {
- log.Printf("skipping %s", fname)
- return nil
- }
-
- log.Printf("Starting to open %s", fname)
-
- img, err := imaging.Open(fname)
- if err != nil {
- return err
- }
-
- croppedImage := imaging.Thumbnail(img, 256, 256, imaging.Lanczos)
- err = imaging.Save(croppedImage, "thumbs/"+filepath.Base(fname)+".thumb.png")
-
- return err
-}