「Linux」- 图片操作

  CREATED BY JENKINSBOT

ExifTool

Homepage: https://sno.phy.queensu.ca/~phil/exiftool
Wikipedia / ExifTool: https://en.wikipedia.org/wiki/ExifTool

Exiv2

Homepage: http://www.exiv2.org

GIMP

GIPHY

https://giphy.com/

GIF 图片检索站点

常用命令

在目录中,找到全部图片

ImageMagick – Format and Print Image Properties
command line – Find images in a Linux directory based on their resolution – Ask Ubuntu

通过 identify 命令,以获取图片格式:

# 如下命令,搜索比较宽泛:只要 identify 能够识别,则视为图片
find ./ -type f -print0 | xargs -0 -i bash -c 'test -n "$(identify -format "%m" "{}" 2>/dev/null)" && echo "{}"'

# 如下命令,缩小搜索范围(为了代码的可读性与美观,因此牺牲性能,但问题不大)
find ./ -type f -print0 | xargs -0 -i bash -c '
file_fmt="$(identify -format "%m" "{}" 2>/dev/null)"
test "${file_fmt}" = "PNG"  && echo "{}"
test "${file_fmt}" = "JPEG" && echo "{}"
'