SI520

/usr/bin/perl w use strict use CGI use CGI::Carp qwfatalsToBrowser use GD use DBI qqqqqqqqqqqqqqqQQQQQQQQQQQQQQQUUUUUUUUTTTTTTT.. 777777777777777777777777777777777 name:seth qqqqqqqqqqqqqqqqqqqqq qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq professional interests:I write computer programs, these days for M Publishing ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ software skills:I have a about 10 years of experience creating web applications. Ive used Photoshop, Flash, Illustrator, but its been a while. These days I write perl / php / javascriptjquery and so forth. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ttttttttttttttttttttttttttttttttttttttttttttt KKtttttttttttttttttttttttttttttKKtttttttttttt expectations: Id link to learn to make art that isnt so messy KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK this was created with a program I wrote in 2003, part of which is listed below GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG FFFFFFFFFFFFFFFFFFFF ZZZZZZZZZZZ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX............. my dbh = DBIconnectdbi:mysql:serth:mysql.serth.org,username,password or die couldnt connnect to db: :nn my q = new CGI my debug = 0 get/set session info require session.pl my url = wtp.cgi my access = wtp.cgi my session = &session::testsessionq, url, access my modifier, image, readfile, colorhash, totalcount, height, width, invert, writechars, brightness, totalcolor, title, size the characters we can acknowledge my @letters = a .. z, , A .. Z, 0 .. 9, . make higher for bigger rectangles, 1 = 1 pixel if qparammodifier { modifier = qparammodifier modifier = 100 } else { modifier = 10 } my text = qparamtext if defined text { &showformq } else { text = substrtext, 0, 400 text =~ s/|||||||||||//g first we need to see if theyve made too many images today "aq invert = true if defined qparaminvert writechars = true if defined qparamwritechars dont even try to write text into a 1 pixel space undef writechars if modifier == 1 readfile = &createreadfile readfile = readfile..png totalcount = &totalcount@letters, text die You entered 3 or less characters or did something weird. sorry.n if totalcount 4 if qparamlayout =~ /vertical/ { height, width = &dimensionstotalcount } else { width, height = &dimensionstotalcount } if qparambrightness { brightness = qparambrightness } else { brightness = 85 default color offset value } colorhash, image = &buildhashheight, width, @letters, modifier, invert, brightness if debug { for keys %colorhash { print key: value: colorhash{} } } size = &writeimage, readfile, width, colorhash, text, modifier, writechars totalcolor = 64 Maybe someday we can change this to add more, but for now leave it. if qparamtitle { title = qparamtitle title =~ s/|||||||||| //g } else { title = readfile } &logq, readfile, text, invert, modifier, brightness, totalcolor, title, size, height, width, session forward them to the gallery why doesnt this work right print qredirectgallery.cgi } sub createreadfile { use Time::localtime my t = localtime my year = tyear+1900 my month = tmon+1 my day = tmday my @chars = A .. Z, a .. z, 0 .. 9 my filename = join, @chars[ map { rand @chars } 1 .. 8 ] filename = year.month.day..filename return filename } sub buildhash { build a hash of letters=GD colorspace colors my height = shift my width = shift my letters = shift my modifier = shift my invert = shift my bright = shift create the image my image = new GD::Image width*modifier, height*modifier or die couldnt create image n my @numbers = [0, 0, 0], [0, 0, 1], [0, 0, 2], [0, 0, 3], [0, 1, 0], [0, 1, 1], [0, 1, 2], [0, 1, 3], [0, 2, 0], [0, 2, 1], [0, 2, 2], [0, 2, 3], [0, 3, 0], [0, 3, 1], [0, 3, 2], [0, 3, 3], [1, 0, 0], [1, 0, 1], [1, 0, 2], [1, 0, 3], [1, 1, 0], [1, 1, 1], [1, 1, 2], [1, 1, 3], [1, 2, 0], [1, 2, 1], [1, 2, 2], [1, 2, 3], [1, 3, 0], [1, 3, 1], [1, 3, 2], [1, 3, 3], [2, 0, 0], [2, 0, 1], [2, 0, 2], [2, 0, 3], [2, 1, 0], [2, 1, 1], [2, 1, 2], [2, 1, 3], [2, 2, 0], [2, 2, 1], [2, 2, 2], [2, 2, 3], [2, 3, 0], [2, 3, 1], [2, 3, 2], [2, 3, 3], [3, 0, 0], [3, 0, 1], [3, 0, 2], [3, 0, 3], [3, 1, 0], [3, 1, 1], [3, 1, 2], [3, 1, 3], [3, 2, 0], [3, 2, 1], [3, 2, 2], [3, 2, 3], [3, 3, 0], [3, 3, 1], [3, 3, 2], [3, 3, 3] my @colors create the GD col if debug { print the numbers: } for @numbers { if debug { print [0], [1], [2] } my color = imagecolorAllocate [0]*bright, [1]*bright, [2]*bright push @colors, color } if debug { print br the colors: @colorsbr } reverse the letters array if so desired if defined invert { @letters = reverse@letters } my %colorhash my i=0 build the letters=GD colorspace hash for @letters { colorhash{} = colors[i] i++ } return%colorhash, image }