You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'm currently implementing smart objects into my Photoshop reader/writer API and those (sometimes) store the raw file bytes directly in memory rather than having a file on disk it references. From what I can tell though OpenImageIO requires a valid filepath to read from an IOProxy. I've thrown together a hacky solution that works but it requires a temporary file to be created in order to actually read the file.
If there is a way to do this natively feel free to point me to it and I'll close this ticket :)
Describe the solution you'd like
A way to create an imageinput purely from memory.
Describe alternatives you've considered
I looked into using an OIIO::ImageBuf for this purpose but it looked like it only supported being backed from pixel buffers? Unsure about this.
The text was updated successfully, but these errors were encountered:
The ceremonial API dance I do for this case is the following:
// During create(), provide _just_ the format extension (psd here) that OIIO will recognize// It will perform a stat/existence check on the "file" but no further filesystem access should occur.
unique_ptr<ImageInput> in = ImageInput::create("psd");
if (!in) {
returnnullptr;
}
// Set the ioproxy and use empty "" path during open()
in->set_ioproxy(&mem_reader);
bool ok = in->open("", newspec, config);
...
Is your feature request related to a problem? Please describe.
I'm currently implementing smart objects into my Photoshop reader/writer API and those (sometimes) store the raw file bytes directly in memory rather than having a file on disk it references. From what I can tell though OpenImageIO requires a valid filepath to read from an IOProxy. I've thrown together a hacky solution that works but it requires a temporary file to be created in order to actually read the file.
If there is a way to do this natively feel free to point me to it and I'll close this ticket :)
Describe the solution you'd like
A way to create an imageinput purely from memory.
Describe alternatives you've considered
I looked into using an
OIIO::ImageBuf
for this purpose but it looked like it only supported being backed from pixel buffers? Unsure about this.The text was updated successfully, but these errors were encountered: