purplecat: Programming the Eniac Computer (programming)
[personal profile] purplecat
A while back I tackled a bug in which icons could not have "0" as a keyword. The problems were all caused by the fact that perl treats "0" as false, so a lot of checks for the existence of a keyword on the icon were failing.

Having fixed that particular problem a host of others have been revealed when someone tries to use an icon with a 0 keyword and I've been working through these.

At present, in my dreamhack, it is possible to make a post with a 0-keyword-icon selected and view that post. However if you then try to edit the post the icon gets replaced by the default icon, and if, in the edit page, you attempt to select a 0 keyword icon, it doesn't get attached to the post in the database.

I'm tearing my hair out over this because I can not identify how icon selection differs in the edit form from the post form. The bug appears both using the new and old versions of the post form so I'm assuming it isn't in the javascript or template toolkit and I'm going cross-eyed grepping the codebase.

One of my problems is I'm not even entirely clear where may be a good point to start inserting some "warn" statements, or how to simulate post editing within the test suite.

Any hints, suggestions or pointers much appreciated.
anarres: (Default)
[personal profile] anarres
This seems like it should be easy but I'm really stuck. I'm trying to dynamically display images - i.e. generate the image with a perl script and display it without saving it to the server.

This simple example works on my Heliohost server, but not on Dreamwidth (the example is from http://www.perlmonks.org/?node_id=18565):

--------test.shtml------------
<img src="test.cgi?size=100" alt="" />
------------------------------


--------test.cgi------------
#!/usr/bin/perl -w

use strict;
use CGI;
use GD;

my $cgi=new CGI;
my $cgi_size=$cgi-&gt;param('size') || '50';

print &quot;Content-type: image/gif\n\n&quot;;
my $gd=new GD::Image($cgi_size,$cgi_size);
my $blue=$gd-&gt;colorAllocate(0,0,255);
$gd-&gt;fill(0,0,$blue);
binmode STDOUT; #just in case we're on NT
print $gd-&gt;gif;
------------------------------


I'm stumped - has anyone got any ideas?

Profile

dw_dev_training: The stylised 'd', with the word 'dev' above, and the word 'training' at the side, representing the dw_dev_training comm. (Default)
Dreamwidth Development Training

January 2017

S M T W T F S
1234567
891011121314
151617 18192021
22232425262728
293031    

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 1st, 2017 12:30 am
Powered by Dreamwidth Studios