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 5344 Feb 8, 2007, 9:17 PM
Thread Re: [SandraR] Image upload space issue
brewt 5251 Feb 8, 2007, 10:15 PM
Thread Re: [brewt] Image upload space issue
SandraR 5236 Feb 9, 2007, 8:25 PM
Thread Re: [SandraR] Image upload space issue
SandraR 5185 Feb 16, 2007, 10:45 AM
Thread Re: [SandraR] Image upload space issue
SandraR 5191 Feb 21, 2007, 8:02 AM
Post Re: [SandraR] Image upload space issue
brewt 5157 Feb 21, 2007, 1:53 PM
Thread Re: [SandraR] Image upload space issue
brewt 5192 Feb 21, 2007, 4:23 PM
Thread Re: [brewt] Image upload space issue
SandraR 5154 Mar 5, 2007, 9:48 AM
Thread Re: [SandraR] Image upload space issue
brewt 5126 Mar 5, 2007, 2:36 PM
Thread Re: [brewt] Image upload space issue
SandraR 5123 Mar 5, 2007, 2:43 PM
Thread Re: [SandraR] Image upload space issue
brewt 5124 Mar 5, 2007, 4:03 PM
Post Re: [brewt] Image upload space issue
SandraR 5120 Mar 5, 2007, 4:47 PM
Thread Re: [SandraR] Image upload space issue
brewt 5126 Mar 5, 2007, 5:49 PM
Post Re: [brewt] Image upload space issue
SandraR 5067 Mar 13, 2007, 5:17 PM