Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added TGA, BMP and PSD readers. Added TGA and BMP writers. #100

Merged
merged 10 commits into from
Jun 28, 2023

Conversation

ggarra13
Copy link
Contributor

They are very light as they rely on two auxiliary .h files (stb_image.h and stb_image_writer.h).

Copy link
Owner

@darbyjohnston darbyjohnston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like an interesting addition, though to be honest I was hoping to leave some of the older formats like TGA behind (DJV has TGA support which I did not port over to tlRender). On the other hand it's not a huge amount of code which is good.

My main concern would be if STB handles reading images from memory? That's necessary for the .otioz support which is essential. Also tests would need to be added similar to the other image formats in "tests\tlIOTest".

Adding these formats also brings up the question of whether to use OpenImageIO instead. That project was recently adopted by ASWF and aligns with the other dependencies like OpenColorIO and OpenTimelineIO. It has support for TGA and BMP, and also others like SGI which would actually remove code from tlRender which would be great.

CMakeLists.txt Outdated Show resolved Hide resolved
lib/tlIO/CMakeLists.txt Outdated Show resolved Hide resolved
lib/tlIO/STB.h Outdated Show resolved Hide resolved
lib/tlIO/STBRead.cpp Outdated Show resolved Hide resolved
lib/tlIO/STBRead.cpp Outdated Show resolved Hide resolved
lib/tlIO/STBWrite.cpp Outdated Show resolved Hide resolved
@ggarra13
Copy link
Contributor Author

My main concern would be if STB handles reading images from memory? That's necessary for the .otioz support which is essential. Also tests would need to be added similar to the other image formats in "tests\tlIOTest".

It does handle images from memory. I added code for it now, but I didn't know how to test it. I also added a STBTest.cpp/.h based on the SGITest but also didn't know how to test it. Can you test them and see if they are okay?

@darbyjohnston
Copy link
Owner

You can run the tests like:

  • make test (when using the CMake Makefile generator)
  • run the test binary directly: tests/tltest/tltest

To test reading from memory you can use an .otioz file. However the "otioconvert" utility doesn't support image sequences yet, but I have a PR to fix that:
AcademySoftwareFoundation/OpenTimelineIO#1627

lib/tlIO/STBRead.cpp Outdated Show resolved Hide resolved
@darbyjohnston
Copy link
Owner

Thanks!

@darbyjohnston darbyjohnston merged commit 974b87b into darbyjohnston:main Jun 28, 2023
@darbyjohnston darbyjohnston added the enhancement New feature or request label Jun 28, 2023
@darbyjohnston darbyjohnston added this to the 1.0 milestone Jun 28, 2023
@ggarra13 ggarra13 deleted the tga_bmp_psd branch September 7, 2023 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants