LunchBox Posted December 17, 2002 Share Posted December 17, 2002 Arrrrrrrrrrgggggggggggghhhhhhhhhhhhh!!!!! I'm now pulling my hair out over this. With my local installation I get no errors at all. Uploaded to my server and when there is no image I'm getting a divide by zero error. I've made a change to resize images. if ( ($width) && ($height) ) { $image_size = @getimagesize($src); $ratio = $width / $image_size[0]; if ($image_size[1]*$ratio > $height) { $ratio = $height / $image_size[1]; $width = $image_size[0] * $ratio; } else { $height = $image_size[1] * $ratio; } $image .= ' width="' . $width . '" height="' . $height . '"'; } The error is occuring on the third line. Only happens on the web server. Please help......... J. Gravity is a myth - the Earth sucks! Link to comment Share on other sites More sharing options...
mattice Posted December 17, 2002 Share Posted December 17, 2002 What is the result of getimagesize() ? That is probably your error but the @ stops it from reporting. Remove the @ and see what it tells you. I'm quite sure it doesn't return the array with the sizes like expected... "Politics is the art of preventing people from taking part in affairs which properly concern them" Link to comment Share on other sites More sharing options...
LunchBox Posted December 17, 2002 Author Share Posted December 17, 2002 Quite right ( as ever :) ) It's reporting an error: Warning: getimagesize: Unable to open 'images/Array' for reading. in /home/temptation/www/catalog/includes/functions/html_output.php on line 108 Any ideas? Could it be folder permissions? J. Gravity is a myth - the Earth sucks! Link to comment Share on other sites More sharing options...
mattice Posted December 17, 2002 Share Posted December 17, 2002 might be permissions yes... but in this case you have tried to upload an Array as the image path... so in your products table it states 'Array' instead of my_nice_image.jpg... fix that, check the permissions on the folder / images and you should be okay... hth Mattice "Politics is the art of preventing people from taking part in affairs which properly concern them" Link to comment Share on other sites More sharing options...
Ajeh Posted December 17, 2002 Share Posted December 17, 2002 *cough* bug on a new product with no image first time through = Array for the image name ... Ian made a nice temp fix for that in the contributions if I am not mistaken. Link to comment Share on other sites More sharing options...
LunchBox Posted December 18, 2002 Author Share Posted December 18, 2002 Small problem... It's not happening for a product (although I have found 2 products that do). It's happening between the category title and the product listings... http://www.fetishheaven.co.uk/catalog/defa....php?cPath=5_24 Warning Adult content. Cheers, J. Gravity is a myth - the Earth sucks! Link to comment Share on other sites More sharing options...
mattice Posted December 18, 2002 Share Posted December 18, 2002 Look for the Array bit in the categories table. Nice parachute but I think I'll pass ;) "Politics is the art of preventing people from taking part in affairs which properly concern them" Link to comment Share on other sites More sharing options...
LunchBox Posted December 18, 2002 Author Share Posted December 18, 2002 I looked for that too. Nothing there. The image name is AP.C2081.jpg Could that be a problem? The extra Period? Cheers, J. Gravity is a myth - the Earth sucks! Link to comment Share on other sites More sharing options...
mattice Posted December 18, 2002 Share Posted December 18, 2002 Don't think so but you're the one that can check ;) "Politics is the art of preventing people from taking part in affairs which properly concern them" Link to comment Share on other sites More sharing options...
LunchBox Posted December 18, 2002 Author Share Posted December 18, 2002 Nope it's not that. What get's drawn there? The category image is being displayed correctly..... I've now got my bum in my hands. Not going to bed until this is fixed. Wife very unhapy. Don't understand why it's working OK on laptop, but not on server. Hmmmmmmmmm......... J. Gravity is a myth - the Earth sucks! Link to comment Share on other sites More sharing options...
mattice Posted December 18, 2002 Share Posted December 18, 2002 if so look in the html source on the laptop what is drawing there... ah... come to think of it: pixel_trans.gif might be it... it used for spacers etc. "Politics is the art of preventing people from taking part in affairs which properly concern them" Link to comment Share on other sites More sharing options...
LunchBox Posted December 18, 2002 Author Share Posted December 18, 2002 It appears to be dying in product_listing.php $list_box_contents = array(); $list_box_contents[] = array('params' => 'class="productListing-heading"'); $cur_row = sizeof($list_box_contents) - 1; for ($col=0; $col<sizeof($column_list); $col++) { switch ($column_list[$col]) { case 'PRODUCT_LIST_MODEL': $lc_text = TABLE_HEADING_MODEL; $lc_align = 'left'; break; Something to do with this.......??????? Help please. J. Gravity is a myth - the Earth sucks! Link to comment Share on other sites More sharing options...
mattice Posted December 18, 2002 Share Posted December 18, 2002 don't think so. That code builds the headings but does not call tep_image() which is causing the error... Did you look at the html source on the laptop? "Politics is the art of preventing people from taking part in affairs which properly concern them" Link to comment Share on other sites More sharing options...
LunchBox Posted December 18, 2002 Author Share Posted December 18, 2002 Laptop isn't drawing anything..... The server source is.... <tr> <td><img src="images/pixel_black.gif" border="0" alt="" width="1" height="1"></td> </tr> <tr> <td> <br /> <b>Warning</b>: getimagesize: Unable to open 'images/Array' for reading. in <b>/home/temptation/www/catalog/includes/functions/html_output.php</b> on line <b>108</b><br /> <br /> The laptop is... <tr> <td><img src="images/pixel_black.gif" border="0" alt="" width="1" height="1"></td> </tr> <tr> <td> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="productListing-heading"> <td align="center" class="productListing-heading"> </td> <td align="left" class="productListing-heading"> <a href="http://localhost/catalog/default.php?cPath=5_24&page=1&sort=2d" title="Sort products descendingly by Product Name">Product Name+</a> </td> J. Gravity is a myth - the Earth sucks! Link to comment Share on other sites More sharing options...
LunchBox Posted December 18, 2002 Author Share Posted December 18, 2002 I'm an idiot. :oops: :stupid: I was expecting the error to occur where the images where missing. But it builds the list first and then displays them. Fixing the Array in the products_images fixed the problem. But why did it not complain on the laptop? A question for another day. I'm going to bed. Thanks for all your help Mattice. I owe you one :) Good Morning. Gravity is a myth - the Earth sucks! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.