novice420
07-20-2004, 02:36 AM
Hello,
I bought an auction.cgi and I am having trouble with pictures displaying on my website. the scripts are supposed to resize photos over 600 pixels... BUT when they are displayed on my site... a photo 555 wide 200 tall will display as 200 wide and 555 tall thus showing a very distorted picture. As far as I can find, this is the only code that I can find that makes the picture size. is it correct? or is there a better code for constaining pictures? any help on this would be greatly appreciated. :thumbsup:
$pic1a="yes";
$pic2a="yes";
$pic3a="yes";
$pic4a="yes";
open (FILE,"$config{'full_item_dir'}/pics/$config{'itemnumber'}.gif") || &pic1();
open (FILE,"$config{'full_item_dir'}/pics/$config{'itemnumber'}.jpg") || &pic2();
open (FILE,"$config{'full_item_dir'}/pics/$config{'itemnumber'}.jpeg") || &pic3();
open (FILE,"$config{'full_item_dir'}/pics/$config{'itemnumber'}.png") || &pic4();
if ($pic1a eq "no" && $pic2a eq "no" && $pic3a eq "no" && $pic4a eq "no") {}
else
{
if ($pic1a eq "yes")
{ $ext=".gif"; }
elsif ($pic2a eq "yes")
{ $ext=".jpg"; }
elsif ($pic3a eq "yes")
{ $ext=".jpeg"; }
elsif ($pic4a eq "yes")
{ $ext=".png"; }
$file = "$config{'full_item_dir'}pics/$config{'itemnumber'}$ext";
$size = &imgsize();
@arr = split(/=/, $size);
@arr1 = split(/ /, @arr[1]);
$sizex = @arr[2];
if (@arr[2] > 600) { $sizex = 600; }
$res = $sizex / @arr[2];
$sizey = $res * @arr1[0];
print "<center><img src=\"$config{'root_url'}$config{'pics_dir'}/pics/$config{'itemnumber'}$ext\" width='$sizey' height='$sizex' border=1></center>";
}
print qq~
I bought an auction.cgi and I am having trouble with pictures displaying on my website. the scripts are supposed to resize photos over 600 pixels... BUT when they are displayed on my site... a photo 555 wide 200 tall will display as 200 wide and 555 tall thus showing a very distorted picture. As far as I can find, this is the only code that I can find that makes the picture size. is it correct? or is there a better code for constaining pictures? any help on this would be greatly appreciated. :thumbsup:
$pic1a="yes";
$pic2a="yes";
$pic3a="yes";
$pic4a="yes";
open (FILE,"$config{'full_item_dir'}/pics/$config{'itemnumber'}.gif") || &pic1();
open (FILE,"$config{'full_item_dir'}/pics/$config{'itemnumber'}.jpg") || &pic2();
open (FILE,"$config{'full_item_dir'}/pics/$config{'itemnumber'}.jpeg") || &pic3();
open (FILE,"$config{'full_item_dir'}/pics/$config{'itemnumber'}.png") || &pic4();
if ($pic1a eq "no" && $pic2a eq "no" && $pic3a eq "no" && $pic4a eq "no") {}
else
{
if ($pic1a eq "yes")
{ $ext=".gif"; }
elsif ($pic2a eq "yes")
{ $ext=".jpg"; }
elsif ($pic3a eq "yes")
{ $ext=".jpeg"; }
elsif ($pic4a eq "yes")
{ $ext=".png"; }
$file = "$config{'full_item_dir'}pics/$config{'itemnumber'}$ext";
$size = &imgsize();
@arr = split(/=/, $size);
@arr1 = split(/ /, @arr[1]);
$sizex = @arr[2];
if (@arr[2] > 600) { $sizex = 600; }
$res = $sizex / @arr[2];
$sizey = $res * @arr1[0];
print "<center><img src=\"$config{'root_url'}$config{'pics_dir'}/pics/$config{'itemnumber'}$ext\" width='$sizey' height='$sizex' border=1></center>";
}
print qq~