forked from lclevy/libcraw2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dng_info.sh
45 lines (42 loc) · 1.43 KB
/
dng_info.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
#to generate dng_info.txt, based on DNG tags converted from CR2 images
DNGCONV=/c/Program\ Files/Adobe/Adobe\ DNG\ Converter/Adobe\ DNG\ Converter.exe
BINPATH=vs2015/libcraw2/x64/Release
#C:\Program Files\Adobe\Adobe DNG Converter
DNGPIC=converted.dng
for pic in `cat samples_list_rggb.txt`; do
#convert the CR2 into DNG
"$DNGCONV" -c -d . -o $DNGPIC $pic
BLACK=""
WHITE=""
MATRIX=""
if [ -f $DNGPIC ]; #if conversion is OK
then #extract values with exiftool
BLACK=`exiftool.exe -s3 -BlackLevel $DNGPIC`
WHITE=`exiftool.exe -s3 -Whitelevel $DNGPIC`
MATRIX=`exiftool.exe -s3 -colormatrix2 $DNGPIC`
rm converted.dng
fi
MODELNAME=`$BINPATH//craw2tool.exe -g 0,272,a $pic`
MODELID=`$BINPATH//craw2tool.exe -g m,16,v $pic`
MODELIDHEX=$(tohex $MODELID)
echo "$MODELIDHEX"r", $MODELNAME, $BLACK, $WHITE, $MATRIX"
done
for pic in `cat samples_list_yuv.txt`; do
#convert the CR2 into DNG
"$DNGCONV" -c -d . -o $DNGPIC $pic
BLACK=""
WHITE=""
MATRIX=""
if [ -f $DNGPIC ]; #if conversion is OK
then #extract values with exiftool
BLACK=`exiftool.exe -s3 -BlackLevel $DNGPIC`
WHITE=`exiftool.exe -s3 -Whitelevel $DNGPIC`
MATRIX=`exiftool.exe -s3 -colormatrix2 $DNGPIC`
rm converted.dng
fi
MODELNAME=`$BINPATH//craw2tool.exe -g 0,272,a $pic`
MODELID=`$BINPATH//craw2tool.exe -g m,16,v $pic`
MODELIDHEX=$(tohex $MODELID)
echo "$MODELIDHEX"y", $MODELNAME, $BLACK, $WHITE, $MATRIX"
done