zoukankan      html  css  js  c++  java
  • imagemagick 批量旋转图片 转为横版式

    批处理脚本 保存为文件rotate.bat 放置于要处理的图片目录

    在命令行下调用 rotate 目录名

    例如 roatate img

    将img文件夹中的所有文件改为横版,宽度大于高度。

    echo off

    setlocal enabledelayedexpansion

    echo ============rotate start============

    ::src forder

    set srcForder=%1

    ::des forder

    set desForder=p_%srcForder%_p

    md %desForder%

    cd %srcForder%

    for /f %%i in ('dir /b *.jpg') do (

    set src=%%i

    set des=../%desForder%/%%i

    identify -ping -format %%[fx:w] !src!>tmp

    set /p width=<tmp

    identify -ping -format %%[fx:h] !src!>tmp

    set /p height=<tmp

    echo !src! width=!width!,height=!height!

    ::if width gtr height

    if !width! lss !height! (

    convert !src! -rotate -90 !des!

    echo rotate...

    ) else (

    copy !src! !des!>nul

    echo copy...

    )

    )

    del tmp

    echo ============rotate   end============

  • 相关阅读:
    Service解析
    Android消息处理
    FragmentTransaction.addToBackStack无效的问题
    Activity生命周期
    width 的100% 与 auto
    parseInt 与 parseFloat 解析
    splice
    <c:forEach>
    笔记,遮罩。。
    nginx 的windows 基本配置
  • 原文地址:https://www.cnblogs.com/oyjj/p/2132884.html
Copyright © 2011-2022 走看看