-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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: JPEG: Support 4-channel CMYK/YCCK images #427
Conversation
This is the last change to handle all images in the ImageNet dataset. (Actually, the dataset includes 26 gzip-compressed JPEGs for some reason, but that seems outside the scope of stb_image.) |
FWIW, I replaced the (a*b+128)/255 for CMYK->RGB conversion with this code (from an algorithm by Jim Blinn):
|
Also, I did have to manually fix a bunch of merge errors between this and rgb-detection (especially since I foolishly tweaked that before I did this merge), so you might want to retest to make sure I didn't inadvertently break anything. |
so you don't get the automatic info you normally do
merged |
I verified that all ImageNet images still decode, and the 4-channel and RGB images still look right. Thanks for incorporating all these changes. Also, nice improvement for the division by 255. |
Thanks for testing and for your fixes! |
160cc6cb9b Travis CI: bump copyright to 2018. [cache clear] a2cfffcd64 Travis CI: bump copyright to 2017. [ccache clear] 32d3a6e9e1 Clean up Image::SavePNG() to use just Image::Save(). Fix jo & stbi_image_write to use wchar paths on Windows. 11253960ae Use file symlink instead of directory for STB library. Fix #1330. a393bee83a Adjust CMakeLists.txt as now STB is a header-only implementation. Additionally, remove all the local changes as they are either not required as the bug has already been fixed upstream or there are other ways to do what we want to do without altering the original code. 28854f9660 Travis CI: bump copyright to 2016. [ccache clear] 2004ddf7b4 Bump copyright to 2015. 1c2e28266a Remove existing include path abstraction. Remove engine's sub-CMakeLists.txt. 73990fefe7 update readme a9672961c9 more cases of STB_NO_HDR and STB_NO_LINEAR interfering 40f43afe56 tweak tests 602e986824 fix STBI_NO_HDR and STBI_NO_LINEAR to compile correctly even if you don't #include <math.h> 085ba4b627 add compilation tests that have no other includes to avoid accidental dependencies 01daa3a244 stb_sprintf: fix size-only snprintf query ccee11ad79 stb_image: fix warnings 3ac351f39d break out stb_lib.h 06fedddb4d fix stb_dxt.h; fix misspelled STB_DXT_IMPLEMENTATION in test jig f2974f6c1c update readme version number 663deb3a43 redo lost stb_vorbis fixes 7855d2dc87 version numbers in readme dfff6f5e7c stb_image: fix assert macro usage; stb_vorbis: changelog 476b4c7a72 update readme 037926ab74 fix warnings, bad error handling b2c2419b1b stb_image: avoid arithmetic overflow in png case 445473bdb5 stb_image_write: handle malloc failure in zlib 4fd9019c0f stb_image: avoid signed left shifts 74a21dc615 fix compiler warnings 9b2522c3d5 stbi_is_hdr_from_file needs to reset file position 87352fdcb5 stb_truetype: fix bug in handling of stbtt_hheap that could cause severe badness db4d92891c fix stb_sdict_for() 3025377f4a fix stb_textedit redo, from omar cornut b969dc38f3 stb_image_write: fix for fopen_s failure case 3f01acced4 stb_textedit: allow overriding key-input typedef d808adb77f stb_dxt: fix bug with constant color & varying alpha 76ec599c68 stb_truetype - remove duplicate definition ee0ebfc79b version numbers 5db03ef592 Merge branch 'master' into working 094cb31ec8 stb_image: compile as C; stb_image_write: credits faf08e0018 Merge branch 'stb_image_write_mscrt_errors' of https://github.com/xeekworx/stb 4254a9f237 stb_truetype credits 8732cff6c4 Merge branch 'winding-lengths-warning' of https://github.com/RobLoach/stb da4a7a1d6f Merge branch 'patch-2' of https://github.com/wojdyr/stb ae00f3a5f0 stb_image credits 1b9689cf77 Merge branch 'feature/gif_frames' of https://github.com/tocchan/stb f9d78c05a9 stb_image credits edf35ad14c Merge branch 'master' of https://github.com/jlnr/stb 0bd0d049e7 stb_image docs ead2b3fe2c Merge branch 'stbi_is_16' of https://github.com/anael-seghezzi/stb 501e29b245 stb_truetype.h docs 986a5eeeb1 fix stb_truetype test file 0b8b3f2876 Merge branch 'stb_truetype_fixes_20171104' of https://github.com/kphillisjr/stb f22857495b Merge branch 'compile' of https://github.com/alculquicondor/stb 0b81a54354 Merge branch 'cff-type2-fixes' of https://github.com/dougallj/stb 72ef9dcbad fix fall-through case warning, add credit 8cc624142b credits 82f1929de5 Merge branch 'patch-1' of https://github.com/darealshinji/stb da4b342213 credits ab4fb5c38a Merge branch '1bit_bmp' of https://github.com/plzombie/stb b0383facf8 Merge branch 'master' of https://github.com/lieff/stb 41cd8bb527 Merge branch 'patch-1' of https://github.com/twoscomplement/stb 5f1a73fe4e credits, tests 9eb0e72950 Merge branch 'must_make_clang_happy_as_clam' of https://github.com/croepha/stb e5946524d7 Merge branch 'patch-1' of https://github.com/wojdyr/stb 3d7b4251f9 Merge branch 'png-ext-write' of https://github.com/akx/stb b48101c971 Merge branch 'update_stbi_jpg_dcoumentation' of https://github.com/Benjins/stb f541fa1710 Merge branch 'valgrind-fix' of https://github.com/rohit-n/stb 35a3bf41e8 Integrate ZLIB changed from Daniel Gibson, fixup credits 9de22e5a70 Merge branch 'stbiw-png-compr' of https://github.com/DanielGibson/stb 39241e4928 update version number b056850ea9 stb_image_write can flip images vertically e371bd83f2 Merge branch 'sb_cpluscplus' of https://github.com/ZenToad/stb 593c9b7192 rewrite stbi__shiftsigned to use a different, faster algorithm to avoid probelm with clang -O2 to outputting buggy code 68f857727c add stb_ucharcmp to stb.h 244d83bc3d fix unchecked length in stb_vorbis that could crash on corrupt/invalid files 76d9e05b2f Merge branch 'stb_image_write_mscrt_errors' of https://github.com/xeekworx/stb into stb_image_write_mscrt_errors 841862a622 Fixed grammar, spelling issues in comments issue #533 eb17d8a6dd Fixed grammar, spelling issues in comments 32a7d5ab68 Added STBI_MSC_SECURE_CRT to support newer MSVC compilers as optional For issue #533 5e844ffe70 Using secure versions of CRT calls to avoid Microsoft Visual C/C++ compiler errors/warnings. 5c2c826df9 stb_truetype: Silence warnings of winding_lengths 3a969eb64c remove duplicated `pr = 0` de75509b1c Remove a nullptr 03b4bbc5d2 Fix a disposal flag mistype. Only clear to background color if index is non-zero. Fixed a the disposal test gif I was using - now renders properly (gif has no transparent set, but all renderers still considered it transparent. Spec says 0 should be ignored if 0, but was confusing by saying it only in the context of the pal not existing.. but seems to be the case always. 28c28b0bd2 Per the contributor doc - added my name. Noticed urraka also did some work here, so hopefully didn't step on any toes. 87a3143fb4 GIF Loading - multiple frames; - Allow loading a gif as multiple frames into a single buffer. Each frame is a full image seperated by a (w * h * comp) stride. - Optionally, can pass in a pointer to a int, which will be filled with an array layers long contain ms for each frame. - Fix gif's not loading the initial transparent background - I believe also fix disposal rules for subsequent frames (though being somewhat inefficient with memory to do so) - Add a flip_vertical that takes into account slices as well. 4bffebc5f0 Avoid warning about unused stbi__float_postprocess fcf0b99601 add stbi_is_16 4c1a786455 Revert "return comp info in bytes (support for 16 bit images)" 9dfa8c7f31 return comp info in bytes (support for 16 bit images) 6e50ac7860 stb_truetype: Fix undefined function warning 5182622b14 tests: fix test_trutype.c on msvc 2015 a981af59c5 Fix tests compilation 1f2b4271e3 stb_truetype: Fix CFF GetGlyphBox optional params 84fd09ea53 stb_truetype: Fix sign error in CFF push immediate b6b43df186 Use stbi__mad4sizes_valid() only if STBI_NO_LINEAR or STBI_NO_HDR are defined 350173026a stb_image: support for 1-bit BMP c06c9fe6bc place const tables to protected .rdata section c8245bbf22 Remove arg from memset macro 2545eee3ef Added myself as a contributor for the pull request f57bc38ff6 Made some changes to make Clang Happy 7d80a8b44d avoid GCC7 implicit-fallthrough warning 2c7b00ac21 Add force_filter and compression_level parameters to (new) `stbi_write_png_to_mem_ex` 923c9c3deb Correct function signature in stbi_write_jpg usage documentation. 747b8d8f71 stb_sprintf.h: Don't compare uninitialized value when using zero. This prevents a "Conditional jump or move depends on uninitialised value(s)" error from valgrind when using zero as an argument in line 1045. 9d9f75eb68 update readme 961923b5a3 fix documentation dd039e8cc5 credits for mingw fixes in #444 3b232a3ff7 Merge branch 'master' of https://github.com/Infatum/stb into dev 555efbedfc Update version numbers 0fbbda56fa stb_image: Account for tRNS chunk in non-paletted images. 7725f8b9cd stb_leakcheck: Derp, I should free the right thing. 5a5cf7f9ba stb_leakcheck: Make stb_leakcheck_free actually free. 5ebeb38edb stb_rect_pack: Remove unused rect_width_compare(). c59cb96874 Merge branch 'fix-issue-461' of https://github.com/rygorous/stb into dev fedf03e774 Merge branch 'fix-issue-466' of https://github.com/rygorous/stb into dev 282576fbfb Merge branch 'rygorous-fix-issue-276' into dev 9b6652fe3a Merge branch 'rygorous-sprintf_reformat' into dev b1d058e5c7 stb_truetype: Fix typo, as pointed out by oyvindjam. 30c7c6b583 stb_truetype: Support reading OS/2 vertical metrics 49c7f1b397 stb_image: Optimise vertical flip. 501812f307 stb_leakcheck: Fix warnings. 931662ae6e stb_image_write: Warning fix. 25a2596b2f stb_image: Fix rounding during unpremultiply. 463dd85f1f Merge branch 'Reedbeta-fix-vs2015-warnings' into dev 3ef1cb174e Merge branch 'fix-vs2015-warnings' of https://github.com/Reedbeta/stb into Reedbeta-fix-vs2015-warnings 69ef103721 Merge branch 'poppolopoppo-load_16_variants' into dev 4868b5283b stb_dxt: Update contributors list. 316571b395 stb_image: 3-char indent and other minor formatting issues. b226e71ce6 Merge branch 'load_16_variants' of https://github.com/poppolopoppo/stb into poppolopoppo-load_16_variants 31f8c2109b Merge branch 'ppiastucki-bc4' into dev e9b8f7ea35 Merge branch 'bc4' of https://github.com/ppiastucki/stb into ppiastucki-bc4 14c2993310 Merge branch 'realitix-robustify' into dev b53457130d Merge branch 'robustify' of https://github.com/realitix/stb into realitix-robustify 7a6251689f Merge branch 'h-s-c-stb_dxt_static' into dev 99df133ae4 Merge branch 'stb_dxt_static' of https://github.com/h-s-c/stb into h-s-c-stb_dxt_static 897e6e8314 Merge branch 'h-s-c-stbi_no_stdio-fix' into dev b119e6d1d2 Merge branch 'stbi_no_stdio-fix' of https://github.com/h-s-c/stb into h-s-c-stbi_no_stdio-fix 24f2522e00 Merge branch 'h-s-c-stb_dxt-freestanding' into dev e1f17c3c6c Merge branch 'stb_dxt-freestanding' of https://github.com/h-s-c/stb into h-s-c-stb_dxt-freestanding aaa793350e Merge branch 'cdwfs-stbtt_const_fontdata' into dev 530c05ee61 Merge branch 'stbtt_const_fontdata' of https://github.com/cdwfs/stb into cdwfs-stbtt_const_fontdata 3870b2fe3b Merge branch 'DanielGibson-write-jpg' into dev 526ed469e2 Merge branch 'write-jpg' of https://github.com/DanielGibson/stb into DanielGibson-write-jpg 2da81a6433 stb_vorbis: MinGW has alloca defined in malloc.h. cc7f1d1e6d stb_image: Documentation fixes. 0674660451 stb_image: Relax raw_len validation for non-interlaced PNGs. 481db7501c stb_sprintf: Remove some gratuitous gotos 7b8955bfaa stb_sprintf: More whitespace cleanups post clang-format cccbc3f5a9 stb_sprintf: Clean up the mess with clang-format 423298e071 fix SDF documentation and add example code 38479bc58c stb_truetype version number 9a2e92e818 SDF documentation fa98e4f6cf Merge branch 'master' into sdf 5defc65c23 Initial SDF support d74530cd10 fix stb_fclose to do a better job of preserving content be21113512 stb_image_write.h: Allow setting custom zlib compress function for PNG e6bbecd3a9 stb_image_write.h: Set PNG compress lvl via stbi_write_png_level f0baa0c287 stb_image_write.h: Fix compilation in C++11 mode cbca86de65 Add myself to contributors list de080e6d0b Fix warning about unreachable code fb524e6768 Fix warning about context parameter being unused when STBIR_MALLOC and STBIR_FREE have their default definitions. 76a1a1c408 Fix variable-shadowing warnings 7091cb6ed6 Fix integer conversion warning 9bcda8bb1c Add stbi_load_16() variants to load from memory or callbacks 84e42c2e8d fix stbi_shiftsigned to be shifting a value that's unsigned 8a55e1e5a5 Add support for BC4 d8796f05bf Robustify stbi__sse2_available in stb_image.h 4963448726 fix: Build on MinGW32 13942348e0 Fixing void * compile error for C++ 50e6be0de6 Edit contributor list. 9b3358fec1 Add feature to replace abs/fabs and memset with your own. 96e1f0474c Edit contributor list. 97ae5fb3db Edit contributor list. 1dfdf5558d Fix STBI_NO_STDIO. dda7d72841 Add STB_DXT_STATIC option. f3d8e52ddc stb_truetype: fontdata can be const in stbtt_PackFontRange[s]() c7110588a4 update README with info about SSE2 on GCC e88fff69bf Merge branch 'working' f1417efd36 update README 2549ffcd82 Merge branch 'working' c0539b4ea5 version; tweak docs bc58f37f06 Merge branch 'stbir_warnings' of https://github.com/BSVino/stb into working d459039f8b Merge branch 'working' d795785f3d docs b577583fb9 Merge branch 'working' 56a61e178f reorganize contributor list (removing one redundant name and adding one new one as well) c79fa78ee8 tweaks to previous merge 351489803f Merge branch 'phprus-patch-1' of https://github.com/phprus/stb into working 37d767c0fc Merge branch 'working' 2de9961443 docs 90e8658d80 Merge branch 'fix_stbimage_pnm_load' of https://github.com/rygorous/stb into working 22ace34bf8 Merge branch 'working' d9e7c55bd7 minor docs for last merge 97c58e3891 Merge branch 'fix_stbimage_gcc_sse2' of https://github.com/rygorous/stb into working eaed281d9d Merge branch 'working' 24fa816116 merge nothings/stb#427 but I messed up the merge so you don't get the automatic info you normally do 32344103df Merge branch 'working' 6d60610348 tweaks to previous merge 00c2545510 Merge branch 'rgb-detect' of https://github.com/jeremysawicki/stb into working 8fe48099cc add comment for next fix prematurely 690ad3f9dd Merge branch 'working' 5bbe1d8c2a fixes to that PR 55112399e6 Merge branch 'master' of https://github.com/uTox/stb into working 30a34d6168 Merge branch 'working' be6d13cd6d fix bug in png decoding with 1,2,4-bpp images using filter that samples previous line 72e0f6c971 Fix whitespace to how Sean likes it 1adb98f142 Fix some MSVC /W4 warnings e5144a3996 stb_image_write.h: Consistently use STBIWDEF for stbi_write_* 721c788fdb stb_image_write: JPEG writer based on jo_jpeg.cpp a99bc0ca32 Fix a bunch of warnings under Apple's clang-800.0.42.1 667f35578b statically initialize 22c72a069c stb_image: Support optional args consistently. 3e17544873 stb_image: Give up trying to runtime-detect SSE2 on GCC. 9e76bb5108 stb_image: JPEG: Improved detection of RGB images 6f6e11f85f readme a463577988 update README w/ MIT info 16c83cd5fc Fix a pair of warnings in stb_image.h be931882ef update README ee19531f68 fix to new bc5 path def6a1898c version number bee6e9fc2e Merge branch 'textedit-line_start_end_handlers' of https://github.com/ocornut/stb into working bd2cb593e0 Merge branch 'old_textedit' into working d052909923 better handle dragging mouse in single-line mode b1a0089c4b stb.h swprintf fix a81422cd80 version number 98e825ac67 Merge branch 'master' into working 07c6c6bc88 Merge branch 'stbir_patch' of https://github.com/BSVino/stb into working a2bc1eabec perlin noise function pull request by Jack Mott but deleted before I could pull it 03611a369e Merge branch 'working' e895f6d3af tweak previous PR merge 9009ae042e Merge branch 'rect-pack-fail' of https://github.com/IntellectualKitty/stb into working fab4c61d45 Merge branch 'working' c918a6b801 tweak previous PR merge 2be620d2bb Merge branch 'lead_sign' of https://github.com/rohit-n/stb into working 324be64e80 version number 3841bc6198 Merge branch 'master' of https://github.com/jarikomppa/stb into working 335565a86f Merge branch 'working' fd912b5d93 version number, doc tweaks 98537b7091 Merge branch 'master' of https://github.com/guitarfreak/stb into working d79487a0ba readme 0c1232f576 version number b280541e6a Merge branch 'stbtt_const_chardata' of https://github.com/cdwfs/stb into working 3afc3de41d version number 83a2489d5b fix compilation on non-C99 compilers ed05048323 Merge branch 'master' of https://github.com/fahickman/stb into working e77673f4aa Merge branch 'patch-1' of https://github.com/bryongloden/stb into working 2d0518833b readme eab4930cc4 Merge branch 'working' 6ba52a370c stb_dxt: extern "C" 4ce23da44a rename 3dc to bc5, tweaks to clean stuff up a217948c16 change 3dc name to bc5 c39063727d Merge branch 'master' of https://github.com/snake5/stb into working 8879908f78 update readme 6a3d4786c9 Merge branch 'unknown-marker' of https://github.com/jeremysawicki/stb into working 7e389e85c1 Merge branch 'dnl-segment' of https://github.com/jeremysawicki/stb into working 15c7e06dc8 Merge branch 'junk-before-marker' of https://github.com/jeremysawicki/stb into working dc6089f05b tweak fill byte PR 50ae79d811 Merge branch 'fill-bytes' of https://github.com/jeremysawicki/stb into working a6dc061137 tweak 16-bit quantization for clarity 0befbc3d78 Merge branch 'dequant-16-bits' of https://github.com/jeremysawicki/stb into working 014af7b78a Merge branch 'component-ids' of https://github.com/jeremysawicki/stb into working 786ac92daa tweak RGB-to-Y conversion 64e1799f24 Merge branch 'rgb-grayscale' of https://github.com/jeremysawicki/stb into working 8905cb9a8e Merge branch 'patch-1' of https://github.com/RufUsul/stb into working 47685c5f84 remove deprecated old-precision jpg path from stb_image.h tweak license reference wording 51a5368dee Merge branch 'master' of https://github.com/pboettch/stb into working e248e30954 change license to public-domain AND mit (based on twitter vote) f88e2a8e7b update version 46046238b8 rename Point data structure as suggested in pull request c88489549d Merge branch 'avoid-name-clash' of https://github.com/jlnr/stb into working f9a83c0ae1 Merge branch 'master' of https://github.com/alxprd/stb into working 66fdbaaa87 Merge branch 'fix_vorbis_ilog' of https://github.com/rygorous/stb into working d2de2be10f vorbis: propagate errors better on seek failure (e.g. when coarse seek fails) f5f7dc02a1 stb_image: JPEG: Provide failure reason for unknown marker 2219a6da29 stb_image: JPEG: Accept DNL segment 6f5677946c stb_image: JPEG: Accept non-zero junk bytes at the end of image data 344c3f73d5 stb_image: JPEG: Accept fill bytes in stbi__grow_buffer_unsafe e08d398671 stb_image: JPEG: Accept 16-bit quantization tables 34fa37bbb4 stb_image: JPEG: Accept any component IDs cb7ffb2408 stb_image: Update contributors 552c548a0e stb_image: JPEG: Convert RGB to grayscale properly f5519a8f85 stbtt: chardata can be const in GetBakedQuad() and GetPackedQuad() 7ef6ac1b35 added redundant pg_test.c just in case 638267b6d5 Floating point rounding causes stbir__calculate_sample_range_upsample to sometimes think it needs one more scanline than it really does. This patch adds one extra entry to the ringbuffer to avoid the problem. 59a5a155b4 Merge pull request #401 from themanagainstthetank/patch-1 52920a2d5e update version numbers 84e2fc0a9e makefile 4d19411acd makefile 1dd1b6c191 makefile c09f1eebe7 makefile 1b7aa1af87 makefile 7e989db555 update stb_image.h d71aea034b makefile a235b6cd44 makefile cf6d17cd74 makefile e29e2bfb12 makefile ea2b06976c Merge branch 'master' of https://github.com/nothings/stb 21913be792 makefile e6268b5558 Delete release_notes.md fc5668cdac makefile for tests 96620a3a54 update version numbers 0bd0a9abc4 stb_truetype: comment typo stb_c_lexer: end-of-array wrapped overflow bug dead3815e2 credits 28c24f7b83 Merge branch 'fix-truncation' of https://github.com/sammyhw/stb into working 48710234f2 credits; 1/2/4-bit png fix; easy font spacing; NO_STDIO in image_write 96714b2a13 Merge branch 'fix_stbi_write_hdr_scope' of https://github.com/poppolopoppo/stb into working 80a39f958f Merge branch 'fix-percent-check' of https://github.com/d26435/stb into working 7bb64aa867 pull request template dcdf02a59f pull request template 73b511b1a3 pull request template 2db6897d48 contributing d36c43f337 contributing.md fc682ec2de update readme f5c9aaacd2 Merge pull request #395 from dougallj/patch-1 9bb7f80cb8 stb_truetype: Fix a couple of CFF bugs 19d03764b5 Fix #ifndef STBI_WRITE_NO_STDIO scioe for stbi_write_hdr() 94374c99c8 Merge branch 'master' of https://github.com/nothings/stb 4f2324c6ad Merge branch 'num-fonts' of https://github.com/IntellectualKitty/stb into working cca943e78a version history 834199151e Merge branch 'is-apple-font' of https://github.com/IntellectualKitty/stb into working 3d1c790e96 version history 53e4334bf7 Merge pull request #363 from mgerhardy/patch-1 d0b576c474 update stb_truetype version ad6614ad9f Merge branch 'cff-type2' of https://github.com/dougallj/stb into type2 d5ec7789bd stb_image_resize update f882db0c80 Merge https://github.com/aras-p/stb into working f07727a28a stb_image.h: large structures on the stack a055654ee3 Rename Point to stbv__point 3f36b29589 Overwrites error parameter in stb_vorbis_open_memory when there is no error. This avoid confusion due to previous values. 99fd236287 Merge branch 'master' of https://github.com/nothings/stb into num-fonts ec9db6f84b allow for all 16 bits 13927ac386 stb_printf.h: Reuse code for assigning lead sign. 4338a0e55e Fix the check for a percent character 0e63382be0 A bit more involved change: support for both 1000 and 1024 divisors, and SI and JEDEC suffixes, as well as removing the space between number and suffix. 3e7f2d6ebd fix missing renames bec0b26d1e Merge branch 'master' of https://github.com/nothings/stb 554e072742 fix #ifdef mistake in stb_sprintf 0c6bd72ccb Merge pull request #377 from aras-p/patch-1 9a3f9dff13 More proper fix for the prefixes (defaults to Ki style, with define for using K style instead) a27e577c3e The Si prefixes for mega, giga and tera are upper case (lower case m is not mega but milli) e6e20b43db stb_sprintf: seperators -> separators typo in comment ca3b8d7426 add credits to readme 9953803d0c fix bad search-replace in comment 3f2716ace4 add stb_sprintf to readme c9fe5bac48 rename all stb_sprintf identifiers to follow stb conventions fd23d7097d rename rrsprintf to stb_sprintf 454ed822a7 deprecate rrsprintf a468fbda72 readme, add rrsprintf.h 75a8fd9d41 Add function to get the number of fonts in a TrueType file 7fa573cd61 Update stb_truetype.h b61b7a74fa update version info b9be4fd8df Merge branch 'merging' into working 0b2c06a7e1 more STB_IMAGE_STATIC fixes 7bcaa93a76 Merge branch 'master' of https://github.com/Zelex/stb into merging Also add more credits Also fix linking multiple copies with STB_IMAGE_STATIC 4a1523f60a make tga load function static to avoid link errors on multiple instances 7759a2a93d fix "misleading indentation" gcc warning ae241feec4 Merge branch 'stb_img_overflows' of https://github.com/rygorous/stb into working 7736399517 return 16-bit PSDs through 16-bit API (untested) 07fefa384a Return all_rects_packed status from stbrp_pack_rects. e0700d8e2c 16-bit png changes 239a6718e1 rename stbi_load parameters to reduce confusion 2a170daee5 warning fixes, more RGBE fix a2defc3d7a added support for RGBE header HDR files cd93a5de11 added basic 3Dc support 996ccf2159 update version numbers 5d9423f8fd fix -Wcast-qual in stb_rect_pack, stb_textedit, stb_truetype 6b66033e18 stb_image: Fix memory leak and missing out-of-mem check. 62f372754f stb_image: Fix HDR/PSD RLE decoders. 02190634c2 stb_image: Overflow checking for image allocs. 8c8d735eb7 stb_image: More input validation in deflate decoder f32854c809 stb_vorbis: Fix handling of negative numbers in ilog. 2f4166e91d stb_connected_components 7d0099ecc9 fix bug in stb_connected_components adjacency list updating incorrectly handling avoiding adding the same connection twice 847d288152 stb_textedit: fix LINESTART when cursor is at end of buffer and no trailing newline. Stopped using find_charpos(), simpler and faster. 6a29bcf2a1 Update stb_voxel_render.h 5fcd181fae Update stb_voxel_render.h dca0a37ff4 other_libs points to new location 1a31473db8 Added block_selector bf1dd13245 Merge branch 'master' of https://github.com/nothings/stb d9e0dfcd63 readme change link to other_libs 5ecb2d86b8 Delete other_libs.md 33ac18a7fb tinyfiledialogs 3dabed0208 Merge branch 'working' 97305532a9 tweak genann f05f8c3348 Merge branch 'codeplea-genann' of https://github.com/codeplea/stb into working f2847a5493 Merge branch 'master' of https://github.com/nothings/stb a117f374b2 update readme with links 3df8926443 Merge branch 'feature/add-link' of https://github.com/1ace/stb into working c36e8ae082 Merge branch 'master' into working 7fa4f12048 tweak doctest 51e136aad7 Merge branch 'patch-1' of https://github.com/onqtam/stb into working cf51044bc6 update stb_pg project 0181b37188 CFF and Type 2 charstream parsing in stb_truetype 4a60c54710 Shouldn't this be 6? f814cd7577 Update other_libs.md 4f51089d1d Update other_libs.md 49d3871d86 stb_c_lexer.h: C99 hex float literals c6b6239357 stb_c_lexer.h: Compile fixes when not using CRT e713a69f1e Update other_libs.md fa775881d6 Update other_libs.md 973ad3611c other_libs updates fa3db1eb89 Merge branch 'working' e3d804279a Merge branch 'patch-1' of https://github.com/terrehbyte/stb into working ac646fdc27 Merge branch 'working' a1b466ab2f Merge branch 'patch-1' of https://github.com/dbohdan/stb into working 2c105e40fc Merge branch 'working' 5e596c8c2d other_libs: fix indentation 5b3957a546 Merge branch 'master' of https://github.com/xelatihy/stb into working 1e87fa472f Merge branch 'working' 1976e1aee5 Merge branch 'master' of https://github.com/jobtalle/stb into working 6704bc4023 Merge branch 'working' 7a02596aae Merge branch 'otherlibs-dg_dynarr' of https://github.com/DanielGibson/stb into working 01dc6abdcf Merge branch 'working' 5db11942d1 Merge branch 'master' of https://github.com/kieselsteini/stb into working 6f72440159 bump version numbers 19c9615e90 rect_pack patch; fix typo in stb_textedit 5ad14faf38 Merge branch 'master' into working 4e758682b0 Minor fixes. 2c71a43206 Merge branch 'working' bde8f7c102 tweaks to stb_textedit custom-move-by-word patch 841930cca4 Merge branch 'textedit-moveright-moveleft' of https://github.com/ocornut/stb into working 50ec40269d Merge branch 'working' 094e8e923b Merge branch 'master' of https://github.com/kritzikratzi/stb into working f4d348de8e Merge branch 'working' 14e6a98469 clarify alloca #include whitelists f4938bfa4d Whitelist the compilers that need malloc.h for alloca a2f50a1b6a Merge branch 'working' 4806aca183 windows fwrite doesn't handle arbitrarily large writes (!); add a bunch of stuff used by my backup program 'smir'; ec6e5e4054 Update other_libs.md f9a04924af Update other_libs.md 00c6078f9d Handmade Math 33b92cab0f Fix link to tinyobjloader-c 8eebc09150 Update stb_c_lexer.h e75ca4234e Update other_libs.md 21ea5487ff Fix crash when resizing large images (signed integer overflow, e.g. at image size of 24000x24000) 734576e6be image-write: fix monochrome bitmap writing from 8-bit-buffers e1970fe456 other_libs.md: Update link for LIL 94dd6fe796 README.md: add direct links to files a2bf7592b6 added doctest to the list with testing frameworks cc1f71c0d1 Changed license to public domain 365441bc7d Added Genann (neural networks) 67e149fe18 Update other_libs.md d38d37c4ef Made link bold be5bf32130 Added ccVector reference 0a5cb57706 other_libs.md: Add DG_dynarr.h 5038c23d8f Added sts_net / sts_mixer to other libraries list f710c23bf7 stb_textedit/stb_text_locate_coord: fix cursor position in the "shouldn't happen, but if it does, fall through to end-of-line case" case (`i=0` causes problems with the return values in this case) 75ce29fe0b stb_textedit: Add support for custom move word left/right handlers REVERT: 1d776c439c Clean up Image::SavePNG() to use just Image::Save(). Fix jo & stbi_image_write to use wchar paths on Windows. REVERT: 229e78a6e0 Use file symlink instead of directory for STB library. Fix #1330. REVERT: 8ff087c01f Adjust CMakeLists.txt as now STB is a header-only implementation. Additionally, remove all the local changes as they are either not required as the bug has already been fixed upstream or there are other ways to do what we want to do without altering the original code. REVERT: c2d8339535 Travis CI: bump copyright to 2016. [ccache clear] REVERT: 4da8de6837 Bump copyright to 2015. REVERT: efac042388 Remove existing include path abstraction. Remove engine's sub-CMakeLists.txt. git-subtree-dir: Source/ThirdParty/STB git-subtree-split: 160cc6cb9b3261b38cfa0214f2514dd8131e76ff
The ImageNet dataset contains 320 4-channel JPEGs:
This fix uses the APP14 segment to distinguish the first two cases, ignoring the component IDs.
The final two images contain only 0xff bytes in the fourth channel, so it is hard to tell whether that channel represents black or alpha or something else. One of the images needs to be decoded like a normal YCbCr JPEG to look correct. The other is an abstract geometric shape, so it is hard to tell what the correct colors are. My best guess is that they are some form of YCbCr + alpha. This fix decodes them as YCbCr and ignores the fourth channel.
This fix does not do proper CMYK->RGB conversion with color profiles, etc., so while the resulting colors look somewhat reasonable they are not exactly correct.
Some changes overlap with RGB detection (#426) -- sorry for any conflicts.