This bug affects comments when uploading an image using the single-file method. The multiple file option is not affected.
The length of a comment is truncated to 512 characters, ignoring the setting "Maximum length of a comment" in the gallery config.
The fault lies in codebase.php in the upload_sgl plugin where the comment length is hard-coded to be 512. It should use the config value $CONFIG['max_com_size']
Line 112 is:
<textarea name="caption" rows="5" cols="40" class="textinput" onkeydown="textCounter(this, 512);" onkeyup="textCounter(this, 512);"></textarea>
Corrected:
<textarea name="caption" rows="5" cols="40" class="textinput" onkeydown="textCounter(this, {$CONFIG['max_com_size']});" onkeyup="textCounter(this, {$CONFIG['max_com_size']});"></textarea>
I've made the change in my 1.6.26 gallery and it works fine.