Crates.io | folderpics |
lib.rs | folderpics |
version | 0.4.0 |
source | src |
created_at | 2020-09-13 07:33:01.949106 |
updated_at | 2020-09-13 07:33:01.949106 |
description | A cli app that watches folders for images and automatically transforms them. |
homepage | https://git.sr.ht/~travisshears/folder-pics |
repository | https://git.sr.ht/~travisshears/folder-pics |
max_upload_size | |
id | 288118 |
size | 33,397 |
ImageMagik utility to resize images automatically based on watched directories.
It will resize to a size specified in the config and convert to .jpg
for smaller file size.
The project is available for OSX via brew:
$ brew tap travisshears/tap https://git.sr.ht/\~travisshears/homebrew-tap
$ brew install folderpics
folderpics
If you have rust it is also possible to clone this repo and install from source.
The app relies on a config file, ~/.folder_pics.yml
, in your home directory. The config file tells
the app which folders to watch for changes, which size to transform the images into, and where to
output the images.
Here is an example .folder_pics.yml
:
sources:
- source_path: "/Users/t.shears/Pictures/resize/450"
dest_patth: "/Users/t.shears/Pictures/resize/450/small"
size: 450
- source_path: "/Users/t.shears/Pictures/resize/900"
dest_patth: "/Users/t.shears/Pictures/resize/900/small"
size: 900
note: the dest_paths need not be nested they can be where ever on your disk just make sure you have write permissions.
I've envisioned three main ways to run the app.
A. Test it out temporally by leaving it running in a terminal somewhere.
For example if you are using tmux you can just leave a pane/window with it running and leave it be for the day.
B. Run it the background but start the background process manually.
Similar to leaving it running in terminal but this will survive on without the terminal.
ex:
$ nohup folderpics >> /tmp/folderpics.log &
note: this process won't close when you close the terminal thanks to nohup
and will be running in
the background thanks to the trailing &
To stop it later run ps aux | grep folderpics
find the process id then kill -9 P_ID
C. Run it in the background with auto start on launch and keepalive via launchd
Running in the background seems to take .02% of my macs cpu. Seems fine to leave it running forever.
Instructions coming soon once I figure this out myself.
Learn more about the Licence at https://anticapitalist.software/
Right now this is a manual process because bumpversion was having problems parsing the string in Config.toml. Make sure to update:
./Config.toml
./Cargo.lock
./src/main.rs