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

Hunterized version 2023.10.12 #1

Open
wants to merge 205 commits into
base: hunter-0.0.0-80c8f6a
Choose a base branch
from

Conversation

JamesEggleton
Copy link

Updates to tip of upstream master branch.
Incorporates all Hunterization from previous v0.0.0-80c8f6a-p0 version, and makes minor updates to CMakeLists.txt .
Fixes a couple of trivial compile errors.
Adopts a YYYY-MM-DD based versioning scheme, since the upstream project lacks an overall version number.

anthofoxo and others added 30 commits December 16, 2020 18:19
It was never designed to be used by anyone but Sean and has
numerous problems; new code should definitely not be using
this.
This allows for compiler verification of the format string
just like printf.
Also fix a "potentially uninitialized variable" warning.

This is a modified version of Alan's original PR that keeps the
table generator in the file (in case there's interest) and also
replaces the expand[] tables with math, since it's trivial.

Fixes issue nothings#1117.
Don't truncate error as aggressively; easily done, but wanted
to keep it separate from the previous change.
Keep STB_DXT_DITHER so as not to break existing code that tries
to enable it, but just leave it permanently off. I originally
introduced it somewhat superstitiously because of the RGB565
endpoint resolution but it never improved either perceptual quality
or objective quality metrics, and the code is appreciably simpler
without it.
va_arg() is in stdarg.h, which is already being included
Should use xh argument not ph (which is the name of the
variable that it actually gets instantiated with the
one time it is used).
Fixes the bug covered by PR nothings#1066, but with a slightly different
fix that's hopefully a bit clearer.
Accidentally introduced during a merge.
These two variables are unused on some targets, resulting in
warnings. Add STBI_NOTUSED around them to suppress those
warnings.
A few were missing. Make sure to always report ouf-of-memory
errors.

Fixes issue nothings#1056.
extend_receive implicitly requires n <= 15 (code length);
the maximum that actually makes sense for 8-bit baseline JPEG is
11, but 15 is the natural limit for us because the AC coding path
stores the number of magnitude bits in a nibble.

Check that DC delta bits are in range before attempting to call
extend_receive.

Fixes issue nothings#1108.
Define lrot in a way that doesn't involve UB when n==0.
Also, the previous patch ensures that n <= 15 for all callers
of stbi__extend_receive, so can remove the (less restrictive)
bounds check for 0 <= n < 17 (the bounds of stbi__bmask)
entirely.

Fixes issue nothings#1065.
For the stb_image fix, also replace the magic 288 with a more
descriptive name while I'm at it.

Fixes nothings#1100
Use an equivalent formulation that has sgn=0 or 1, not 0 or -1.
This avoids right-shifting signed values, at least in this place.

Fixes issue nothings#1061.
NBickford-NV and others added 24 commits November 29, 2022 00:36
Specifically, this rejects length codes 286 and 287, and distance codes 30 and 31.
This avoids a scenario in which a file could contain a table in which
0 corresponded to length code 287, which would result in writing 0 bits.

Signed-off-by: Neil Bickford <[email protected]>
As suggested by "mupfdev" on Github. We don't have a way to test
here but seems simple enough.

Fixes issue nothings#1321.
Limit to 1k, which is the maximum size of a 256-entry palette that
would ordinarily go there. It feels sensible to relax this a bit but
we don't want to go overboard.

Fixes issue nothings#1325.
Be a bit more picky about what we consider a valid marker.
0xff 0x00 (stuffed 0 byte) should not count.

Fixes issue nothings#1409.
For paletted images, header-scanning mode (used by stbi_info) kept
going after the image header to see if a tRNS (transparency) chunk
shows up to correctly determine the channel count, but we would
immediately return after IHDR for non-paletted images.

This is incorrect. We also change our reported channel count on
RGB images with a tRNS chunk, therefore non-paletted images also
have to resume scanning further chunks.

Update the logic to keep scanning regardless and report the
correct channel count from stbi_info for RGB images with tRNS
(constant alpha channel).

Fixes issue nothings#1419.
@JamesEggleton
Copy link
Author

@NeroBurner the upstream repo lacks project versions (but individual headers are versioned), so the two most recent Hunterized versions have used the version naming convention "0.0.0--pX".
It's not very intuitive because the MAJOR.MINOR.PATCH numbers never change, so you have to inspect the git tree to understand version history. I figured that adopting YYYYMMDD as a version number is more helpful than 0.0.0 . Do you have a view on this? I'm happy to revert to 0.0.0--pX if that's the Hunter way. Thank you.

 - Update paths used in GenerateHeader(...) calls
 - Require CMake 3.5+ as per Hunter project
 - Update version number: use YYYYMMDD notation because the upstream repo is not versioned
@NeroBurner
Copy link

let's do a mix. Use a version number the timestamp of the commit and as extension the short-sha. Then we can easily find the commit with the short-sha and also easily understand the chronological ordering

So the version in CMake should (or could be) 2023.10.12 and the tag will be v2023.10.12-beebb24-p0

Please also add a comment in CMakeLists.txt at the project() statement that the version number is the date-timestamp of the upstream commit in format YYYY.MM.DD

@NeroBurner NeroBurner self-assigned this Nov 3, 2023
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

Successfully merging this pull request may close these issues.