【问题标题】:write width and height of an image in txt file with batch用批处理在txt文件中写入图像的宽度和高度
【发布时间】:2015-05-15 17:41:46
【问题描述】:

如何使用 ffmpeg 或 irfanview 在新文件中保存图像大小(宽度和高度)?

我希望它像这样保存:

img.png 800 600
img2.png 640 480
....

提前致谢。

【问题讨论】:

    标签: windows image batch-file command-line ffmpeg


    【解决方案1】:

    如果您准备使用免费且可用于 Windows 的 ImageMagick,您可以通过它实现您的目标

    identify -format "%f %w %h\n" *png  > someFile.txt
    

    输出

    baddies.png 500 500
    bar.png 4422 480
    blobs.png 500 500
    board.png 100 100
    datebar.png 100 60
    explain.png 1769 480
    

    顺便说一句,Windows 记事本和其他人可能会更好地使用 Windows 样式的换行符,因此您可以将我的答案中的 \n 替换为 \r\n 以使它们更快乐。

    【讨论】:

      猜你喜欢
      • 2016-02-07
      • 2016-11-01
      • 1970-01-01
      • 2020-10-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-05
      相关资源
      最近更新 更多