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

stb_image.h needs "#if defined(STBI_NO_PNG) && defined(STBI_NO_PSD) && defined(STBI_NO_PNM)" #1469

Closed
ghesketh opened this issue Apr 12, 2023 · 1 comment

Comments

@ghesketh
Copy link

ghesketh commented Apr 12, 2023

Describe the bug
build fails if STBI_NO_PNG and STBI_NO_PSD are defined but STBI_NO_PNM is not defined

lines 1798 and 1807 of stb_image.h:
#if defined(STBI_NO_PNG) && defined(STBI_NO_PSD)

stbi__pnm_load() uses stbi__convert_format16() and stbi__convert_format16() uses stbi__compute_y_16()

To Reproduce
#ifndef STBI_NO_PNG
#define STBI_NO_PNG
#endif

#ifdef STBI_NO_PNM
#undef STBI_NO_PNM
#endif

#ifndef STBI_NO_PSD
#define STBI_NO_PSD
#endif

Expected behavior
allow PNM support without PNG and PSD support

Screenshots
n/a

@agouguai
Copy link

Maybe you can try the following code;

#if defined(STBI_NO_PNG) && defined(STBI_NO_PSD) && !defined(STBI_NO_PNM) replace #if defined(STBI_NO_PNG) && defined(STBI_NO_PSD

agouguai added a commit to agouguai/stb that referenced this issue Oct 31, 2023
@ghesketh ghesketh closed this as not planned Won't fix, can't repro, duplicate, stale Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants