hypothetical-inc / gaffer

Gaffer is an open source application framework designed specifically for creating tools for use in visual effects production.
http://imageengine.github.io/gaffer/
BSD 3-Clause "New" or "Revised" License
59 stars 3 forks source link

Gaffer oslImage node does not support backslashes in filename #8

Open BigRoy opened 5 years ago

BigRoy commented 5 years ago

Version: Gaffer Windows 0.54.1.0-beta

Description

When using oslImage node the filename attribute does not support backslashes unlike the ImageReader node which does support it.

Steps to reproduce

  1. Create OSLImage (with the capital O!)
  2. Pin the viewport to the OSLImage node. (to avoid crash, see #7)
  3. Click on the + in the Node Editor, add Standard > RGB
  4. Create an oslImage node (no capital O).
  5. Connect oslImage output to the RGB input of the OSLImage node.
  6. Set image path on the oslImage node.

Note how the image does display when it's using regular slashes and fails to work if the path contains backslashes. It does not crash and fails with errors in the command prompt.

Workaround

For those requiring to use the oslImage node use forward slashes.

Debug log

The command line reports the following error which shows that the path it passes on to OSL completely excludes the backslashes:

ERROR: [RendererServices::texture] Image ""C:UsersRoyDownloadsgaffer.png"" does not exist. Also, it is not the name of an image format that OpenImageIO recognizes.

ERROR: [RendererServices::texture] Could not open file "C:UsersRoyDownloadsgaffer.png"

The path set in this case was: C:\Users\Roy\Downloads\gaffer.png

ericmehl commented 5 years ago

Thanks for flagging that @BigRoy, I'll have a look at it. I'm actually kind of surprised that ImageReader does work with back slashes - there's a good chance that we will settle on using forward slashes in all user-facing UI for cross-platform compatibility.

I'll investigate to come up with a more considered conversation though.