Skip to content

Commit

Permalink
Better oiiotool support of multiple subimages (AcademySoftwareFoundat…
Browse files Browse the repository at this point in the history
…ion#2202)

Background:

By default, most oiiotool operations ignore multiple subimages. For
commands that modify metadata in place, that means it will only modify
the first subimage (leaving the rest untouched). For commands that
remove inputs from the stack and produce outputs to be put back on the
stack, generally their output will only be based on the first
subimage, and subsequent subimages will be dropped.

`-a` says that any ops ought to work on all subimages if at all
possible; that means that in-place metadata modifiers will apply to
all subimages, and stack ops should produce outputs with the same
number of subimages as their inputs, doing the right operation to each
subimage in turn.

Most commands (but not 100%) also respect an optional
`:allsubimages=VAL` that override `-a` on that one command, `=1` turns it
on even if you didn't use `-a`, and `=0` turns it off even if you did use
`-a`.

My goal is to make all commands respect the `-a` and `:allsubimages=VAL`
options, in all cases except where there is no sensible interpretation
to multiple subimages. There are a few now where there is a sensible
behavior, but it's just not implemented.

This patch fixes the following:

* These commands previously honored `-a` but did not respect a
  ":allsubimages=" modifier, but now they do:
    --sattrib   --attrib   --caption   --clear-keywords
    --iscolorspace  --orientation  --clamp  --fixnan

* These were totally unaware of subimages, neither responding to -a
  nor to ":allsubimages=", now they respect both:
    --crop  --fullsize  --zover  --fill

* These previously always operated on all subimages, but now work on
  only one subimage by default (like the rest) and respect the -a and
  ":allsubimages=" modifier:
    --origin   --fullpixels  --croptofull  --trim
  • Loading branch information
lgritz committed May 31, 2019
1 parent 00c8748 commit 1a21399
Show file tree
Hide file tree
Showing 2 changed files with 190 additions and 151 deletions.
Loading

0 comments on commit 1a21399

Please sign in to comment.