All patches are copyrighted by me and licensed with the respective licenses of the patched source distributions.
If OpenGL is used for creating images with transparency, and images and drawing primitives are rendered on transparent background, the OpenGL Blending functions in standard do not blend the colours correctly. In case the background is completely transparent, and a semitransparent (translucent) colour or image is drawn on top of that, the usual Blending Function behaves incorrectly:
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);The extended version of this common function fixes the problem with incorrect Alpha values in the resulting image, but fails to fix the color channels:
glBlendFuncSeparateEXT (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);The color channels are mixed with these settings with this formula: (Example for Red)
Rd = destination Red Ad = destination Alpha Rs = source Red As = source Alpha R' = result destination Red A' = result destination Alpha A' = As + (1 - As) * Ad R' = As * Rs + (1 - As) * Rd Example: As = 0.5 Rs = 0.8 Ad = 0 Rd = 0.2 R' = As * Rs + (1 - As) * Ad = 0.5 * 0.8 + 0.5 * 0.2 = 0.5This is incorrect, the correct R' is obviously 0.8, because Ad = 0, and Rd should not affect the resulting colour at all! The solution is to compute the R' by weighing the Rs and Rd with their alphas relative to resulting alpha:
R' = As/A' * Rs + (1-As/A1) * Rd R' = 0.5/0.5 * 0.8 + (1-0.5/0.5) * 0.2 = 1 * 0.8 + 0 * 0.2 = 0.8This is correct. These patches create extension
GL_FORECA_blend_relativethat introduces Blending Functions GL_SRC_ALPHA_RELATIVE_FORECA and GL_ONE_MINUS_SRC_ALPHA_RELATIVE_FORECA that can be used to implement the latter formula:
Use this to set the correct blending function:
glBlendFuncSeparateEXT (/* sfactorRGB */ GL_SRC_ALPHA_RELATIVE_FORECA, /* dfactorRGB */ GL_ONE_MINUS_SRC_ALPHA_RELATIVE_FORECA, /* sfactorA */ GL_ONE, /* dfactorA */ GL_ONE_MINUS_SRC_ALPHA);
Until now, I have thought that it is almost impossible to enable ECC functionality after the BIOS has booted the computer. Many people in the ECC mailing list have confirmed that, and I have not known of anyone even attempting that seriously. The problem is that all of memory has to be written to with correct checksum mode enabled before the checking and correction of errors can be enabled. This is usually done in BIOS, as there are no other processes running.
Today, 2005-06-21, I noticed however that using the Athlon64 hardware scrubbing feature allows the memory to be initialized completely before enabling the checking of memory reads. The scripts below have worked for me, and I have verified that the correct ECC modes are enabled (with ecc.pl), and that single bit errors introduced by grounding memory data leads result in correct reports in CPU Northbridge registers.
Testing the ECC functionality can be done with following steps:
the GNU wget. With these options the FTP or HTTP protocol is used to
only download requested portion of the remote file. FTP download
works first by using the REST, restart, command to start download at
--skip-bytes value, and then the data connection is
--limit-bytes mark is reached. WIth
Range: header is used to request a part of the
When opening bitmap fonts like X11 PCF fonts with Freetype2 and FTGL as FTGLPixmapFont, FTGL incorrectly does not check for bitmap type returned from Freetype2. In case of PCL fonts for example, the bitmap is FT_PIXEL_MODE_MONO bitmap and not the FT_PIXEL_MODE_GRAY type requested. This fixes the issue by converting from bitmap to pixmap. This bug is still present in 2.1.2 and SourceForge svn trunk, I'll try to contact the authors again.
For the svn trunk: ftgl-2.2trunk-bitmapfont.diff
For the most current release version:FTGL-2.1.2.bitmapfont.diff
For old versions:ftgl-2.0.11.bitmap-pixmap.diff
giflib-4.1.4.diff fixes a couple of permissions problems when writing gif's and then fixes the giftext utility. It did not print gif comments correctly. Original source: giflib-4.1.4.tar.bz2
mod_auth_mysql-2.20-multiple.diff introduces a new directive to Apache configuration:
Auth_MySQL_Multiple_Passwords on/off Whether or not to allow multiple passwords. If the database table includes multiple rows for single username and this is set to 'On', accept any one of the passwords. If this is 'Off', multiple rows on password table for one username results in an error. Default: Off.
PHP developers: please consider including these patches to PHP-4, PHP-5, and PHP-6:
php-5.0.2-gifanim.diff - and php-4.3.9-gifanim.diff - patches to php-5.0.2 and -4.3.9. Implements functions for creating fairly optimized GIF89a animations. The configuration part of the patch might not be as beautiful as it could, I hope someone of the developer could help here. I hope this gets included in future releases of PHP.
The patch implements three new functions, imagegifanimbegin(), imagegifanimadd(), and imagegifanimend(). With these functions, animated gif images can be created on the fly with php. The documentation for the functions is included in php-doc-anim.diff (this may be outdated). Note that the animations are not optimized as heavily as with some programs like gifsicle, but if you plan carefully you can get fairly good optimization on the fly.
I am in no way promoting GIF format over such superior formats as PNG, MNG or JPEG, but for some todays applications GIF format still has its uses. For example PNG and MNG are not supported in any 3G mobile terminals and GIF89A is the only way to create animations for visually attractive content. Even Mozilla project does not include MNG support for their code by default, so GIF89A is the only option.
Note! If you are using mod_perl also with Apache, you must not use the included libgd in php distribution, but you have to configure with external php library, the same one perl GD module uses. Otherwise you will get segmentation faults.
gd-2.0.30 includes my patches. Below you can find what I submitted to Thomas Boutell. Please use gd-2.0.30 instead of these patches.
gd-2.0.28-gifanim.diff - a patch to gd-2.0.28 to make it write animated gif files. The documentation is also updated. Also, a new function gdImageOpenPolygon is present. I needed it to quickly draw continuous lines without closing it to a polygon shape. This version now includes also pretty good optimization. I hope this will be included in the next release of gd.
This patch does not include the changes for gif support any more as it is already present in gd-2.0.28 since the patents expired. This site used to carry a good selection of gif patches for gd: http://www.rime.com.au/gd/.
One small change with freetype font handling is also included. The error message "Could not set character size" is removed and the error from FT_Set_Char_Size() function is ignored. This allows X font files to be used more easily.
GD-2.16-gifanim.diff - a patch to perl module that implements the perl interface to the above patched gd-2.0.28. Includes full documentation.
I have patched the current Linux ECC release ecc-0.12 to support AMD 761 chipset and to support hardware scrubbing and multiple error reporting. The base distribution does not allow the module to detect any errors after the first one, as it does not clear the error condition in the chipset registers. Currently this is enabled for amd 751, amd 761, intel 430hx and intel 440bx chipsets. It is easy to enable it for other chipsets also, if you just dig up the information from the documentation.
Diffs relative to ecc-0.12 are here: ecc-0.12-jh.diff. Pathched source is here: ecc-0.12-jh.tar.gz.