On Thu, Apr 5, 2012 at 1:39 AM, Larry Gritz <[email protected]> wrote:
> On Apr 4, 2012, at 7:30 AM, Chris Foster wrote:
>
>> Wasn't the main point of the patch that create() opens and closes the
>> file internally, so you always have one call to open behind the scenes?
>> I feel like I'm missing something here.
>
> valid_file would let the create-without-open variety to just return
> the right kind of ImageInput for that file type, but not open the file
> even once. Maybe you want a fully generic one. Or maybe you want to
> create the II but stash it for opening later on.
Oh I see! So I rather missed the point of your original patch,
which was to rely entirely on valid_file() inside create() when do_open
was false. Clearly I should have read the newly proposed create() code
;-)
The proposed version of create() seems more reasonable to me now, though
I think a new open() is more readable in user code:
ImageInput* file = ImageInput::open("blah.tif");
vs
ImageInput* file = ImageInput::create("blah.tif", true);
~Chris
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org