Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [brewt] Image upload space issue

Quote Reply
Re: [brewt] Image upload space issue In reply to
Hello Adrian,


You are not going to believe it but I finally got it to work with one exception -- It still refuses to show up on the page.

When I modify the link and click View (Upload_Image download view Delete)
it shows up fine but the darned image still refuses to show up on the page, if you upload an image without the spaces it shows up fine.

global modified
Code:
sub {
my $field = shift;
my $tags = GT::Template->tags;
my $id = $tags->{ID};
if ($tags->{$field})
{

my $links_db = $DB->table('Links');
my $fh = $links_db->file_info( "$field", $id );
return "" unless($fh);

my $location = $fh->File_RelativePath;
my $logow = 75;
my $extra_atts="oriw=$tags->{LogoWidth}";
if($field eq "Logo" && $tags->{LogoWidth} ne "$logow"){
eval{
use Image::Magick;
};
$@ and return $@;

my $i= new Image::Magick();
my $if = $CFG->{build_root_path} . "/Upload_Image/";

my $error = $i->Read($if);
return "Could not read $if file. Reason:" . $error if $error;

my $w = $i->Get('width');
$extra_atts .= ";width =$w";
if($w ne "$logow"){
my $h = $i->Get('height');

my $logoh = int($h*($logow/$w));
$error = $i->Resize(geometry => "${logow}x$logoh", width => $logow, height => $logoh);
return "Could not read $if file. Reason:" . $error if $error;
$extra_atts .= ";height=$h";
my $rs = $i->Write($if);

}

$links_db->update({LogoWidth => $logow},{ID => $id}) if($tags->{LogoWidth} ne "$logow");

}


return qq~$CFG->{build_root_url}/Upload_Image/~;
}
else
{
return "";
}
}

Thanks for you help


Sandra Roussel
Chonsa Group Design - Fresh Start Housing
Subject Author Views Date
Thread Image upload space issue SandraR 5227 Feb 8, 2007, 9:17 PM
Thread Re: [SandraR] Image upload space issue
brewt 5136 Feb 8, 2007, 10:15 PM
Thread Re: [brewt] Image upload space issue
SandraR 5119 Feb 9, 2007, 8:25 PM
Thread Re: [SandraR] Image upload space issue
SandraR 5067 Feb 16, 2007, 10:45 AM
Thread Re: [SandraR] Image upload space issue
SandraR 5073 Feb 21, 2007, 8:02 AM
Post Re: [SandraR] Image upload space issue
brewt 5043 Feb 21, 2007, 1:53 PM
Thread Re: [SandraR] Image upload space issue
brewt 5077 Feb 21, 2007, 4:23 PM
Thread Re: [brewt] Image upload space issue
SandraR 5037 Mar 5, 2007, 9:48 AM
Thread Re: [SandraR] Image upload space issue
brewt 5011 Mar 5, 2007, 2:36 PM
Thread Re: [brewt] Image upload space issue
SandraR 5006 Mar 5, 2007, 2:43 PM
Thread Re: [SandraR] Image upload space issue
brewt 5007 Mar 5, 2007, 4:03 PM
Post Re: [brewt] Image upload space issue
SandraR 5005 Mar 5, 2007, 4:47 PM
Thread Re: [SandraR] Image upload space issue
brewt 5011 Mar 5, 2007, 5:49 PM
Post Re: [brewt] Image upload space issue
SandraR 4953 Mar 13, 2007, 5:17 PM