Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Two bugs in photos part.

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 2318 Views
  • mateusz.ujma
    Avatar
    Google Summer of Code Hacker
    6 Posts

    Two bugs in photos part. Link to this post

    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.

  • Andy
    Avatar
    230 Posts

    Re: Two bugs in photos part. Link to this post

    Good spotting on number 1, it will fixed for 2.0.1. Thanks!

    I'll have a look into number 2..

  • Sigurd
    Avatar
    Forum Moderator
    628 Posts

    Re: Two bugs in photos part. Link to this post

    Cheers Mateusz; again, like Elijah, its great to see you Google Summer of Coders scanning through code and providing patches, which, as Andy suggests, are now available for download This supports how you've been ranked for Google to approve for tomorrow's judgement day

    2318 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.