1.
Class GD located in sapphire/filesystem/GD.php
static function color_web2gd($image, $webColor) {
if(substr($webColor,0,1) == "#") $webColor = substr($webColor,1);
$r = hexdec(substr($webColor,0,2));
$g = hexdec(substr($webColor,2,2));
$b = hexdec(substr($webColor,2,2));
return imagecolorallocate($image, $r, $g, $b);
}
$g is the same as $b should be $b = hexdec(substr($webColor,4,2));
2.
If image gets corrupted during upload process i.e. network problems, resizing function will throw Fatal Error or cause a segmentation fault.