(no subject)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

(no subject)

Alexie Papanicolaou
Hello Lincoln et al,

apologies i sent this to the biographics-commits (because of gmod.org -> mailing lists -> component lists). Anyway:

I just came across this issue with Bio::Graphics using SVG. It does not
happen with png.

It seems that Bio::Graphics::Glyph::xyplot::
_draw_boxes make a call to
GD::SVG with a very high integer value


*1073742019 at /usr/local/share/perl/5.14.2/GD/SVG.pm line 1120.*
    GD::SVG::Image::_get_color('GD::SVG::Image=HASH(0x39be900)',
1073742019) called at /usr/local/share/perl/5.14.2/GD/SVG.pm line 1094
    GD::SVG::Image::_build_style('GD::SVG::Image=HASH(0x39be900)',
'116-40-153.015', 1073742019, 1073742019) called at
/usr/local/share/perl/5.14.2/GD/SVG.pm line 573
    GD::SVG::Image::rectangle('GD::SVG::Image=HASH(0x39be900)', 40,
153.015, 41, 174.75, 1073742019, 1073742019) called at
/usr/local/share/perl/5.14.2/GD/SVG.pm line 595
    GD::SVG::Image::filledRectangle('GD::SVG::Image=HASH(0x39be900)', 40,
153.015, 41, 174.75, 1073742019) called at
/usr/local/share/perl/5.14.2/Bio/Graphics/Glyph/xyplot.pm line 346

Bio::Graphics::Glyph::xyplot::_draw_boxes('Bio::Graphics::Glyph::xyplot=HASH(0x39cc258)',
'GD::SVG::Image=HASH(0x39be900)', 40, 35, 174.75) called at
/usr/local/share/perl/5.14.2/Bio/Graphics/Glyph/xyplot.pm line 206

Bio::Graphics::Glyph::xyplot::draw('Bio::Graphics::Glyph::xyplot=HASH(0x39cc258)',
'GD::SVG::Image=HASH(0x39be900)', 40, 35, 0, 1) called at
/usr/local/share/perl/5.14.2/Bio/Graphics/Glyph.pm line 1055

Bio::Graphics::Glyph::draw_it('Bio::Graphics::Glyph::xyplot=HASH(0x39cc258)',
'GD::SVG::Image=HASH(0x39be900)', 40, 35, 0, 1) called at
/usr/local/share/perl/5.14.2/Bio/Graphics/Glyph/track.pm line 54

Bio::Graphics::Glyph::track::draw('Bio::Graphics::Glyph::track=HASH(0x39cbec8)',
'GD::SVG::Image=HASH(0x39be900)', 40, 35, 0, 1) called at
/usr/local/share/perl/5.14.2/Bio/Graphics/Panel.pm line 602
    Bio::Graphics::Panel::gd('Bio::Graphics::Panel=HASH(0x369d918)') called
at /usr/local/share/perl/5.14.2/Bio/Graphics/Panel.pm line 1152
    Bio::Graphics::Panel::svg('Bio::Graphics::Panel=HASH(0x369d918)')
called at /home/pap056/workspace/dew/dew.pl line 2887

sudo cpan GD SVG GD::SVG Bio::Graphics
CPAN: File::HomeDir loaded ok (v0.98)
CPAN: CPAN::SQLite loaded ok (v0.202)
Database was generated on Mon, 19 May 2014 05:53:04 GMT
CPAN: Module::CoreList loaded ok (v2.49_02)
GD is up to date (2.53).
SVG is up to date (2.59).
GD::SVG is up to date (0.33).
Bio::Graphics is up to date (2.37).
Ubuntu 12.04.4 LTS \n \l
perl v5.14.2


The problem seems to lie here:
  # Make the boxes transparent
  my $positive = $self->pos_color + 1073741824;
  my $negative = $self->neg_color + 1073741824;
[..]
my $partcolor = $self->code_option('part_color');
[..]
  # special check here for the part_color being defined so as not to
introduce lots of
    # checking overhead when it isn't
    if ($partcolor) {
        $color    =
$self->translate_color($factory->option($part,'part_color',0,0));
        $negcolor = $color;
    } else {
        $color    = $positive;
        $negcolor = $negative;
    }


What is the purpose of adding 1073741824 ? There isn't an color index above
200 when i dump the GD object. It seems that this integer addition is mainly for PNG formats and transparency? If I remove this addition, then the SVG works fine and the image is correct. Perhaps we could check if the image format is PNG and only add 1073741824 then?



many thanks
a

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Gmod-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-devel