I think my question is best explained through an example:

$ maketx --colorconvert linear sRGB foo.png -o foo.tx
... creates a foo.tx
$ maketx  -colorconvert linear linear  foo.png -o foo.tx -u
... does nothing since timestamps are the same
$ maketx  -colorconvert linear linear  foo.png -o foo.tx -u
... does nothing since timestamps are the same
$ maketx foo.png -o foo.tx -u
... does nothing since timestamps are the same

Wouldn't it be better if instead of just checking timestamps, it also
checked if the arguments used to create the .tx file are different?  Then
you'd get something like:

$ maketx --colorconvert linear sRGB foo.png -o foo.tx
... creates a foo.tx
$ maketx  -colorconvert linear linear  foo.png -o foo.tx -u
... updates foo.tx
$ maketx  -colorconvert linear linear  foo.png -o foo.tx -u
... does nothing since the resulting file would be the same
$ maketx foo.png -o foo.tx -u
... updates file since arguments are different (let's not try to think too
hard about whether linear to linear would have done the same thing or not).
$ maketx foo.png -o foo.tx -u
... does nothing since the resulting file would be the same
$ maketx foo.png -u
... ideally would do nothing, but I wouldn't be too upset if it updated.
$ maketx -u foo.png
... do nothing.  We should ignore ordering differences when applicable

I can imagine trying to handle all cases is rather complicated (such as
different arguments that produce the same image), but if we can at least
get the easy cases, and if in doubt, always do an update, I imagine that
would handle 99% of the use cases and would only have the drawback that
very rarely maketx would end up doing redundant work, which is annoying but
at least results in a correct file.

Thiago
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to