summarylogtreecommitdiffstats
path: root/_dngconverter
blob: daff86d4b4e1004a09df0959b7a59bd2918e587a (plain)
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
#compdef dngconverter

# see: https://wwwimages.adobe.com/content/dam/Adobe/en/products/photoshop/pdfs/dng_commandline.pdf

_dngconverter(){
  local opts=('-d[directory]:directory:_directories'
              '-f[file name]:()'
              '-e[embed original]'
              '-fl[embed fast load data]'
              '-lossy[use lossy compression (preserves pixel count by default)]'
              '-side[long-side pixels value (32 to 65000)]:pixels:()'
              "-count[megapixels limit 1024 or greater]:pixels:($(seq 2084 2048 36900))"
              '-x[extract embedded raw]'
              '-o[<filename> (base-)name of output file(s)]:()'
              '*:files:_files')

  [[ $words =~ -cr[0-9]\.[0-9] ]] \
    || opts+=('-cr2.4[raw compability 2.4 or later]'
              '-cr4.1[raw compability 4.1 or later]'
              '-cr4.6[raw compability 4.6 or later]'
              '-cr5.4[raw compability 5.4 or later]'
              '-cr6.6[raw compability 6.6 or later]'
              '-cr7.1[raw compability 7.1 or later (default)]')

  [[ $words =~ -dng[0-9]\.[0-9] ]] \
    || opts+=('-dng1.1[backward version 1.1]'
              '-dng1.3[backward version 1.3]'
              '-dng1.4[backward version 1.4 (default)]')

  [[ $words =~ (-c|-u|-l) ]] \
    || opts+=('-c[output compressed (default)]' 
              '-u[output uncompressed]' 
              '-l[output linear]')

  [[ $words =~ (-p0|-p1|-p2) ]] \
    || opts+=('-p0[no preview]'
              '-p1[medium size preview (default)]'
              '-p2[full size preview]')

  _arguments $opts
}

_dngconverter