Scripteen - Web Scripts - Forum: Getimagesize() Error On View Page Fix - Scripteen - Web Scripts - Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Getimagesize() Error On View Page Fix

#1 User is offline   ptejada Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 9
  • Joined: 09-March 10

Posted 09 March 2010 - 08:20 PM

I've seen enough topics for this issue. This error is suppose to be fixed in the the next release but feel free to adopt my solution to this problem.

Replace Line 111 from view.php
<img id="photo" src="<?= $file_path.$file ?>" alt="<?=$line[filename]?>" title="<?=$line[filename]?>" border="0" width="<?=$width?>" />

with
<img id="photo" src="<?= $file_path.$file ?>" alt="<?=$line[filename]?>" title="<?=$line[filename]?>" border="0"  style="max-width:500px" />


and
Delete This chunk from the file view.php (line 99-108)
<? 
list($file_width, $file_height, $ext) = getimagesize($file_path.$file);
if (!$ext) {echo "Can not get image dimensions!";}
else {
if($file_width>"500") { 
$width=500;
} else {
$width=$file_width;
} }
?>


This solution doesn't have any side effects on the script.
What this solution does is eliminate a unnecessary process in PHP from the script and replaces it with a simple inline CSS rule:
max-width: 500px;

hope it helps anyone...
0

#2 User is offline   GskRckZ Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 01-April 10

Posted 10 June 2010 - 07:07 PM

Thanks Buddy.....it worked like a charm. :)
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users