Skip to content

Commit f578096

Browse files
authored
int: Rename env OIIOTOOL_METADATA_HISTORY -> OPENIMAGEIO_METADATA_HISTORY (#4368)
It's not just in oiiotool. This seems clearer and adheres to the env variable naming convention we chose. Reminder: This controls whether command line history gets written to output image metadata by default by oiiotool and maketx. We historically did it, but recently stopped because of security concerns. Signed-off-by: Larry Gritz <lg@larrygritz.com>
1 parent e947e79 commit f578096

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

src/doc/imageioapi.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,10 @@ inside the source code.
370370
take precedence. If neither is set, the default will be 0, which means
371371
to use as many threads as there are physical cores on the machine.
372372

373-
``OIIOTOOL_METADATA_HISTORY``
373+
``OPENIMAGEIO_METADATA_HISTORY``
374374

375-
If set to a nonzero integer value, `oiiotool` will by default write the
376-
command line into the ImageHistory and Software metadata fields of any
375+
If set to a nonzero integer value, `oiiotool` and `maketx` will by default
376+
write the command line into the ImageHistory and Software metadata fields of any
377377
images it outputs. The default if this is not set is to only write the
378378
name and version of the software and an indecipherable hash of the command
379379
line, but not the full human-readable command line. (This was added in

src/doc/oiiotool.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1991,7 +1991,7 @@ current top image.
19911991
image to potentially reveal any proprietary information that might have
19921992
been present in the command line arguments.
19931993

1994-
If the `OIIOTOOL_METADATA_HISTORY` environment variable is set to a
1994+
If the `OPENIMAGEIO_METADATA_HISTORY` environment variable is set to a
19951995
nonzero integer value, the `--history` option will be enabled by default,
19961996
but can be disabled on the command line with `--no-history`.
19971997

@@ -2002,7 +2002,7 @@ current top image.
20022002
Prior to OpenImageIO 2.5.11, the full information was always written, but
20032003
could be overridden with `--nosoftwareattrib`. Beginning with 2.5.11, the
20042004
default changed to only write the software name and version (unless the
2005-
`OIIOTOOL_METADATA_HISTORY` environment variable is set), and require the
2005+
`OPENIMAGEIO_METADATA_HISTORY` environment variable is set), and require the
20062006
new `--history` option to cause the command line arguments to be written
20072007
as metadata.
20082008

src/maketx/maketx.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626

2727
using namespace OIIO;
2828

29-
#ifndef OIIOTOOL_METADATA_HISTORY_DEFAULT
30-
# define OIIOTOOL_METADATA_HISTORY_DEFAULT 0
29+
#ifndef OPENIMAGEIO_METADATA_HISTORY_DEFAULT
30+
# define OPENIMAGEIO_METADATA_HISTORY_DEFAULT 0
3131
#endif
3232

3333

@@ -185,12 +185,12 @@ getargs(int argc, char* argv[], ImageSpec& configspec)
185185
bool cdf = false;
186186
float cdfsigma = 1.0f / 6;
187187
int cdfbits = 8;
188-
#if OIIOTOOL_METADATA_HISTORY_DEFAULT
188+
#if OPENIMAGEIO_METADATA_HISTORY_DEFAULT
189189
bool metadata_history = Strutil::from_string<int>(
190-
getenv("OIIOTOOL_METADATA_HISTORY", "1"));
190+
getenv("OPENIMAGEIO_METADATA_HISTORY", "1"));
191191
#else
192192
bool metadata_history = Strutil::from_string<int>(
193-
getenv("OIIOTOOL_METADATA_HISTORY"));
193+
getenv("OPENIMAGEIO_METADATA_HISTORY"));
194194
#endif
195195
std::string incolorspace;
196196
std::string outcolorspace;

src/oiiotool/oiiotool.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ using pvt::print_info_options;
5353
# define OIIO_UNIT_TESTS 1
5454
#endif
5555

56-
#ifndef OIIOTOOL_METADATA_HISTORY_DEFAULT
57-
# define OIIOTOOL_METADATA_HISTORY_DEFAULT 0
56+
#ifndef OPENIMAGEIO_METADATA_HISTORY_DEFAULT
57+
# define OPENIMAGEIO_METADATA_HISTORY_DEFAULT 0
5858
#endif
5959

6060

@@ -174,12 +174,12 @@ Oiiotool::clear_options()
174174
output_dither = false;
175175
output_force_tiles = false;
176176
metadata_nosoftwareattrib = false;
177-
#if OIIOTOOL_METADATA_HISTORY_DEFAULT
177+
#if OPENIMAGEIO_METADATA_HISTORY_DEFAULT
178178
metadata_history = Strutil::from_string<int>(
179-
getenv("OIIOTOOL_METADATA_HISTORY", "1"));
179+
getenv("OPENIMAGEIO_METADATA_HISTORY", "1"));
180180
#else
181181
metadata_history = Strutil::from_string<int>(
182-
getenv("OIIOTOOL_METADATA_HISTORY"));
182+
getenv("OPENIMAGEIO_METADATA_HISTORY"));
183183
#endif
184184
diff_warnthresh = 1.0e-6f;
185185
diff_warnpercent = 0;

0 commit comments

Comments
 (0)