Commit Graph

1678 Commits

Author SHA1 Message Date
Daniel Gibson 1ad30e4e77 stb_image_write.h: Fix jpg flipping for non-multiple-of-8 sizes
JPG always encodes 8x8 pixel blocks. If the input image does not have
a width or height that's a multiple of 8, the last column or row is just
used multiple times for the remaining pixels of the block.
The original code first calculated p (the index into the pixel data)
with the "imaginary" row/colum (that might be up to 7 pixels too far
into each direction) and then subtracted the necessary amount of bytes
it if row >= height or col >= width.
That was a bit cryptic (IMHO), and didn't get more readable/obvious when
vertical flipping was added - which introduced a bug, by not taking
stbi__flip_vertically_on_write into account when adjusting p for
row >= height...

The code should be more obvious (and less buggy) now.

This fixes bug #592
2018-04-09 01:24:17 +02:00
Omar Cornut cc99df4b48 stb_truetype: added comment about stbtt_FindGlyphIndex() return value. 2018-03-08 17:14:31 +01:00
PopPoLoPoPpo f685ee4e58 Fix overflow in stbi_write_hdr_core()
b056850ea9 left an additional multiplication by x,
leading to overflow.
2018-02-27 00:08:45 +01:00
Omar Cornut 4716080627 stb_truetype: fix unused variable warning when asserts are disabled. 2018-02-23 11:11:05 +01:00
JR d0ae424061 Re added unicode filename support for stb_image and stb_image_write with whitespace issues fixed. 2018-02-20 21:38:00 -05:00
Mikhail Morozov fa8fe30532
Merge pull request #1 from nothings/master
Update stb
2018-02-13 18:01:46 +03:00
Omar Cornut eb3c5db96c stb_reck_pack: Removed unused assigned variables (under #ifdef _DEBUG wrap) 2018-02-13 11:21:43 +01:00
luz.paz 622b3adad3 Misc. comment typos
Found via `codespell -q 3`
2018-02-12 14:54:22 -05:00
Sean Barrett e6afb9cbae update readme 2018-02-11 11:57:53 -08:00
Sean Barrett fa2a1d9b3b stb_image version number 2018-02-11 11:57:40 -08:00
Sean Barrett 0707304469 update readme 2018-02-11 11:56:13 -08:00
Sean Barrett 19850aa29a Merge branch 'working' 2018-02-11 11:56:08 -08:00
Sean Barrett af786f9883 update readme 2018-02-11 11:55:27 -08:00
Sean Barrett 0c11c4f1b6 rework GPOS support for old non-declare-anywhere C 2018-02-11 11:53:29 -08:00
Sean Barrett 6d59a4913f Merge branch 'stb-truetype-gpos-request' of https://github.com/danielmaciel/stb into working 2018-02-11 11:44:27 -08:00
Sean Barrett cd62aa9714 docs 2018-02-11 11:42:05 -08:00
Sean Barrett ac66307576 docs 2018-02-11 11:41:20 -08:00
Sean Barrett b79c8458d3 stb_vorbis: avoid NaN due to uninitialized variable 2018-02-11 11:29:53 -08:00
Sean Barrett 543ad0c112 stb_image_write: tweak handling of STB_IMAGE_WRITE_STATIC 2018-02-11 11:29:32 -08:00
Sean Barrett aeb2b4b64d tweak handling of STBIWDEF 2018-02-11 11:19:45 -08:00
Sean Barrett dbf0fab1c7 stb_image_write: credits 2018-02-11 11:11:39 -08:00
Sean Barrett 2886b67f7f Merge branch 'stb_image_write_png_filters_fix' of https://github.com/kosua20/stb into working 2018-02-11 11:09:07 -08:00
Sean Barrett 6382814b8c Merge branch 'image_write_variable_typos' of https://github.com/cap/stb into working 2018-02-11 11:05:58 -08:00
Sean Barrett 4eef034d52 stb_write_image: fix typos 2018-02-11 11:05:20 -08:00
Cap Petschulat 6ab920bb6a stb_image_write: fix png compression level typos 2018-02-05 15:48:17 +09:00
Simon Rodriguez 34f087ce4c stb_image_write: fix indexing error when computing PNG filters with the stbi__flip_vertically_on_write on.
The PNG filters of the pixels row N are computed using row N-1 of the final image. If the image should be flipped when saving, this corresponds to row N+1 of the initial image.
2018-02-04 20:12:20 +01:00
Sean Barrett a77d9213e4 stb_vorbis: no dealloca 2018-02-01 03:53:17 -08:00
Sean Barrett a6796aee40 test stb_lib 2018-01-31 10:46:31 -08:00
Sean Barrett 0ba9ff6599 stb_image: fix unused variable warning 2018-01-31 07:50:07 -08:00
Jordan Peck 15685cc4d4
Removed seed from documentation 2018-01-31 12:33:35 +00:00
Sean Barrett 6ba21df503 update dsp with new compile tests 2018-01-30 17:33:17 -08:00
Sean Barrett 48168170a1 stb_truetype: add STBTT_fmod 2018-01-30 17:05:57 -08:00
Jordan ca6548c30a Changed gradient idx table to match previous implementation, removed seeds from public API 2018-01-30 21:03:35 +00:00
Sean Barrett 73990fefe7 update readme 2018-01-30 05:48:45 -08:00
Sean Barrett a9672961c9 more cases of STB_NO_HDR and STB_NO_LINEAR interfering 2018-01-30 05:45:59 -08:00
Sean Barrett 40f43afe56 tweak tests 2018-01-30 05:40:17 -08:00
Sean Barrett 602e986824 fix STBI_NO_HDR and STBI_NO_LINEAR to compile correctly even if you don't #include <math.h> 2018-01-30 05:39:29 -08:00
Sean Barrett 085ba4b627 add compilation tests that have no other includes to avoid accidental dependencies 2018-01-30 05:31:18 -08:00
Sean Barrett 01daa3a244 stb_sprintf: fix size-only snprintf query 2018-01-30 05:29:31 -08:00
Sean Barrett ccee11ad79 stb_image: fix warnings 2018-01-30 05:28:37 -08:00
Sean Barrett 3ac351f39d break out stb_lib.h 2018-01-30 05:16:47 -08:00
Sean Barrett 06fedddb4d fix stb_dxt.h; fix misspelled STB_DXT_IMPLEMENTATION in test jig 2018-01-30 02:56:16 -08:00
Daniel Ribeiro Maciel e460d1a8d8 Add basic GPOS kerning 2018-01-30 00:12:46 -02:00
Sean Barrett f2974f6c1c update readme version number 2018-01-29 15:21:12 -08:00
Sean Barrett 663deb3a43 redo lost stb_vorbis fixes 2018-01-29 15:20:54 -08:00
Sean Barrett 7855d2dc87 version numbers in readme 2018-01-29 14:52:14 -08:00
Jordan 67f588cbb5 Added seed to perlin and fractals
Removed broken wrap from fractals
Used varied seeds for fractal octaves to remove artifact at origin
Removed indicies table in favour of mod12 permutation table, this reduces gradient bias and gives 3% performance increase
2018-01-29 22:50:45 +00:00
Sean Barrett dfff6f5e7c stb_image: fix assert macro usage; stb_vorbis: changelog 2018-01-29 13:15:10 -08:00
Sean Barrett 476b4c7a72 update readme 2018-01-29 08:22:21 -08:00
Sean Barrett 037926ab74 fix warnings, bad error handling 2018-01-29 08:18:19 -08:00