From b88a4f6589bac9d5831692a04f0952ce3300ab0d Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Wed, 15 Oct 2025 17:44:30 -0500 Subject: add dwim shell command for optimizing for email --- modules/dwim-shell-config.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'modules/dwim-shell-config.el') diff --git a/modules/dwim-shell-config.el b/modules/dwim-shell-config.el index a1ace2be..2865dd86 100644 --- a/modules/dwim-shell-config.el +++ b/modules/dwim-shell-config.el @@ -713,11 +713,17 @@ Supports docx, odt, and other pandoc-compatible formats." (cj/xdg-open output-file) (message "Opened %s" output-file))))))) - +(defun cj/dwim-shell-commands-optimize-image-for-email () + "Optimize image(s) for email - reduces file size while maintaining quality. +Resizes to max 1200px (only if larger), strips metadata, and applies JPEG optimization." + (interactive) + (dwim-shell-command-on-marked-files + "Optimize for email" + "magick '<>' -strip -resize '1200x1200>' -quality 85 -interlace Plane -colorspace sRGB -sampling-factor 4:2:0 '<>_email.<>'" + :utils "magick")) (defun cj/dwim-shell-commands-kill-gpg-agent () "Kill (thus restart) gpg agent. - Useful for when you get this error: gpg: public key decryption failed: No pinentry gpg: decryption failed: No pinentry" -- cgit v1.2.3