Loading images that have been converted from .tif

Godot Version

4.2 stable


EDIT: I think I’m a fool. The conversion appears to be an illusion. The issue isn’t with Godot, but with the fact that the images are not, in fact, being properly converted from .TIFs. That leaves a whole new challenge, but not one involving Godot.

I’m writing a program that performs needs to load .tif images files. That filetype isn’t supported by Godot, but (on Windows, not sure about other OS’s) you can just rename the file to .png, .jpeg or .jpg and it will handle the conversion for you. I can open the converted images in other programs (paint, inkscape, whatever) just fine.

However, when I try to load the image in Godot (Image.load_from_file(path)), it fails (load_from_file returns null, and it throws ERR_FILE_CORRUPT). My code works just fine on other images (downloaded from pixabay, screenshots, whatever), just not these converted .tif files.

At this point, I’ve tried a variety of things. Scrubbing the metadata, controlling for bit depth, etc. Nothing works, except for resaving the file via Paint, Photos, or some similar software. When doing this, the file shrinks considerably, but nothing else changes (at least, nothing per the file’s properties window). However, the file can then be opened without issue.

This could be a solution if I needed to open a few images once in a while, but my intentions require this program to be able to open many images, and this just wouldn’t scale.

Any help would be appreciated.