计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
resize-image【效率与协作】Resize images to specific dimensions or percentages
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Resize images to specific dimensions, percentages, or file sizes using ImageMagick.
apt-get update && apt-get install -y imagemagick
# Resize to specific width (height auto-calculated to maintain aspect ratio)
convert "<user's_image_path>" -resize 800x "<output_image_path>"
# Resize to specific height (width auto-calculated to maintain aspect ratio)
convert "<user's_image_path>" -resize x600 "<output_image_path>"
# Resize to exact dimensions (may distort image)
convert "<user's_image_path>" -resize 800x600! "<output_image_path>"
# Resize to fit within dimensions (maintains aspect ratio)
convert "<user's_image_path>" -resize 800x600 "<output_image_path>"
# Resize by percentage
convert "<user's_image_path>" -resize 50% "<output_image_path>"
# Batch resize all images in a directory
for img in *.jpg; do convert "$img" -resize 1920x1080 "resized_$img"; done
The default resize maintains aspect ratio. Use the '!' flag to force exact dimensions if needed.