Krolyxon
Commit b32aefc

Branches

Refs →

nsxivb32aefc

Make image-info script more steady to special symbols in file names

Author
Sudo Nice
Date
2015-12-23 12:43 +0300
Committer
Bert Münnich · 2015-12-25 11:23 +0100
Parent
93e2d03
Commit
b32aefce3a8c98c3ddb35f8f5e89b56ca757ad61

+5 −7

2 files changed

  1. M Makefile +1 −1
  2. M exec/image-info +4 −6
M Makefile View
@@ -1,4 +1,4 @@
1−VERSION := 1.3.2
1+VERSION := git-20151225
22
33 PREFIX := /usr/local
44 MANPREFIX := $(PREFIX)/share/man
M exec/image-info View
@@ -7,13 +7,11 @@
77
88 s=" | " # field separator
99
10−filename=$(basename "$1")
11−filesize=$(du -Hh "$1" | cut -f 1)
10+filename=$(basename -- "$1")
11+filesize=$(du -Hh -- "$1" | cut -f 1)
1212
13−geometry=$(identify -format '%wx%h' "$1[0]")
14−
15−tags=$(exiv2 -q -P v -g "Iptc.Application2.Keywords" "$1" | tr '\n' ',')
16−tags=${tags%,}
13+geometry=$(identify -format '%wx%h' ":$1[0]")
14+tags=$(identify -format '%[IPTC:2:25]' ":$1" | tr ';' ',')
1715
1816 echo "${filesize}${s}${geometry}${tags:+$s}${tags}${s}${filename}"
1917