OSL texture won't work if saved from Blender

I have this odd problem - my texture is showing up purple in cycles using OSL but the code is correct.

At first I thought I was just messing up the path to the image, but then I got it working using a different image. It seems it doesn’t work when I used an image I saved from Blender - in my case it’s a normal map baked and then saved to disk.

Even if I open the saved image, and re-save it, or even export as a different type, no luck. The only way I can use it is by opening a non blender saved image, pasting it over the top and exporting it.

I can’t figure out what property of the image saved in Blender is stopping it from working. Any suggestions?

So I had a chance to try to get to the bottom of it - I didn’t, but I found a solution. Having two identical files (copied the data in a hex editor) still results in one working, and one not (the blender one not working, the one created fresh in ms paint working).

The only solution I can find is to rename the file, or originally save from blender, with capital letters. Yeah. So for example:
-saving as ‘test.png’, fails
-rename to ‘banana.png’, fails
-rename to ‘BANANA.png’, works
-rename back to anything with all lowercase, fails

When I save from blender straight to ‘TEST.png’ it works.

Frankly I have no idea what’s going on, it’s pretty hard to get to the bottom of it because a lower case name will sometimes work if it isn’t created. It’s inconsistent in this regard, but consistently works with capital letters in the filename.

Anyway this is a solution for me I suppose and I post it in case someone else comes across this problem.