Welcome, Guest. Please login or register.
Login with username, password and session length


It's a release candidate! VirtueMart 2.0 RC - the next generation VirtueMart - is available! Read more....

  Advanced search

247038 Posts in 67506 Topics- by 258314 Members - Latest Member: aniketana
Pages: [1]   Go Down
Print
Author Topic: -- SOLVED images on frontend not visible -- SOLVED  (Read 6209 times)
hero
Jr. Member
**
Posts: 77


« on: January 27, 2008, 19:31:47 PM »

IGNORE THIS POST

Changing the CHMOD in general Joomla config to 644 did the trick.
I am a happy man !

--------

Hello,

Using
VM 1.0.13a
Joomla 1.0
PHP 5

I have searched different forums in order to get a response to this one.

I am adding products to my shop.. no problem so far
Adding a picture is also ok , but is not visible on frontend.

VM changed the filename to a hashkey file, which I understand, but it isnn't visible !

I have tried following items :
CHMOD the directory and files to 777 or 655 as advised in a topic : NO RESULT
changed in the MYsql table vm_product_table. There I changed the thumb image and big image file to a normal file name : NO RESULT

I also checked the content of show_image_in_imgtag.php (because that file came up a lot in forum topics).
to my knowledge everything seems ok

I quote the php just to be sure :

Code:
define('_VALID_MOS', 1);
include_once("../../configuration.php");
include_once("../../administrator/components/com_virtuemart/virtuemart.cfg.php");

// Image2Thumbnail - Klasse einbinden
include( CLASSPATH . "class.img2thumb.php");

$basefilename = @basename(urldecode($_REQUEST['filename']));
$filename = IMAGEPATH."product/".$basefilename;
$filename2 = IMAGEPATH."product/resized/".$basefilename;
$newxsize = @$_REQUEST['newxsize'];
$newysize = @$_REQUEST['newysize'];
$maxsize = false;
$bgred = 255;
$bggreen = 255;
$bgblue = 255;

/*
if( !isset($fileout) )
$fileout="";
if( !isset($maxsize) )
$maxsize=0;
*/

/* Minimum security */
if( !file_exists( $filename ) && !file_exists( $filename2 )) {
die('File does not exist');
}

$fileinfo = pathinfo( $filename );
$file = str_replace(".".$fileinfo['extension'], "", $fileinfo['basename']);
// In class.img2thumb in the function NewImgShow() the extension .jpg will be added to .gif if imagegif does not exist.

// If the image is a gif, and imagegif() returns false then make the extension ".gif.jpg"

if( $fileinfo['extension'] == "gif") {
  if( function_exists("imagegif") ) {
    $ext = ".".$fileinfo['extension'];
    $noimgif="";
  }
  else {
    $ext = ".jpg";
    $noimgif = ".".$fileinfo['extension'];
  }
}
else {
  $ext =  ".".$fileinfo['extension'];
  $noimgif="";
}

if( file_exists($filename2)) {
$fileout = $filename2;
} else {
$fileout = IMAGEPATH."/product/resized/".$file."_".PSHOP_IMG_WIDTH."x".PSHOP_IMG_HEIGHT.$noimgif.$ext;
}

// Tell the user agent to cache this script/stylesheet for an hour
$age = 3600;
header( 'Expires: '.gmdate( 'D, d M Y H:i:s', time()+ $age ) . ' GMT' );
header( 'Cache-Control: max-age='.$age.', must-revalidate' );

if( file_exists( $fileout ) ) {
  /* We already have a resized image
  * So send the file to the browser */
 
  switch($ext)
{
case ".gif":
header ("Content-type: image/gif");
readfile($fileout);
break;
case ".jpg":
header ("Content-type: image/jpeg");
readfile($fileout);
break;
case ".png":
header ("Content-type: image/png");
readfile($fileout);
break;
}
}
else {
  /* We need to resize the image and Save the new one (all done in the constructor) */
  $neu = new Img2Thumb($filename,$newxsize,$newysize,$fileout,$maxsize,$bgred,$bggreen,$bgblue);
 
  /* Send the file to the browser */
  switch($ext)
{
case ".gif":
header ("Content-type: image/gif");
readfile($fileout);
break;
case ".jpg":
header ("Content-type: image/jpeg");
readfile($fileout);
break;
case ".png":
header ("Content-type: image/png");
readfile($fileout);
break;
}
}
?>


I hope you can all help me out.

How display the images on the frontend ?



« Last Edit: January 28, 2008, 00:53:40 AM by hero » Logged
Joseph Kwan
Advanced
Hero Member
*****
Posts: 2115


« Reply #1 on: January 28, 2008, 00:22:30 AM »

please provide a sample site url.
Logged

Pay service to make VM work according to your needs. Your Joomla/VM solutions are just a PM away
Joseph Kwan

VM Themes and Templates explained in detail

Projects contributed:
  Excel Product Upload
  Two Product Thumbs
  Bulk Update of Order Status
and many more.
hero
Jr. Member
**
Posts: 77


« Reply #2 on: January 28, 2008, 00:52:52 AM »

thank you for your reply.

I have searched all night, and just 10 minutes ago I found the solution  Embarrassed

it's a newbie error, I presume.

In meantime I am joomfishing virtuemart... also a challenge Smiley
Logged
amperex
Newbie
*
Posts: 9


« Reply #3 on: September 28, 2008, 04:22:19 AM »

Hello,
I have the same problem I cant find a solution after a big deep search.

Please can you write here How you resolve this?

Thanks
Logged
kaye10
Newbie
*
Posts: 16

Feed me with info...


WWW
« Reply #4 on: September 02, 2009, 12:02:25 PM »

Can you tell me how you solved it? i have the same problem.

Hello,
I have the same problem I cant find a solution after a big deep search.

Please can you write here How you resolve this?

Thanks
Logged
Pages: [1]   Go Up
Print
Jump to: