rapt Posted October 29, 2008 Posted October 29, 2008 Hello. I have not made any changes for a while and now all of a sudden my images are not loading. www.ledbulbs.co.nz It is strange because the images are working in the admin part. I thought it might have been something in the configure but I can not see anything wrong. define('HTTP_SERVER', 'http://ledbulbs.co.nz'); // eg, http://localhost - should not be empty for productive servers define('HTTPS_SERVER', ''); // eg, https://localhost - should not be empty for productive servers define('ENABLE_SSL', false); // secure webserver for checkout procedure? define('HTTP_COOKIE_DOMAIN', 'kiwiwebhost.fanconi.net.nz'); define('HTTPS_COOKIE_DOMAIN', ''); define('HTTP_COOKIE_PATH', '/'); define('HTTPS_COOKIE_PATH', ''); define('DIR_WS_HTTP_CATALOG', '/'); define('DIR_WS_HTTPS_CATALOG', ''); define('DIR_WS_IMAGES', 'images/'); define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/'); define('DIR_WS_INCLUDES', 'includes/'); define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/'); define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/'); define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/'); define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/'); define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/'); define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/'); define('DIR_FS_CATALOG', '/home/rapt/public_html/'); define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/'); define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/'); // define our database connection define('DB_SERVER', 'localhost'); Any suggestions would be helpful.
bning Posted October 29, 2008 Posted October 29, 2008 Seems strange. Your broken images have the directory 'http:///product_thumb.php?img=http://kiwiwebhost.fanconi.net.nz/~rapt/images/' and the filename '1156base.jpg&w=100&h=74'. Seems you are using the on the fly thumbnailer. Please could you post an example of the code where a picture is produced on one of your pages ? (i.e. tep_image(DIR_WS_IMAGES . "freedeliv.gif", "Free UK Mainland Delivery")). If is using tep_image the please could you post your version of the tep_image() function as found in the \includes\functions\html_output.php file.
rapt Posted October 30, 2008 Author Posted October 30, 2008 Hello. Here are some examples of the image output tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) I know this image is not working. <?php echo tep_image(DIR_WS_IMAGES . 'table_background_confirmation.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?> <?php echo tep_image(DIR_WS_IMAGES . 'table_background_products_new.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?> tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif'); Yes I am using the on the fly thumbnailer. I am not sure what version it is but here is the info from the output.php. If you can help me fix it I will buy you a couple of beers! //// // The HTML image wrapper function // "On the Fly" Auto Thumbnailer using GD Library, servercaching and browsercaching // Scales product images dynamically, resulting in smaller file sizes, and keeps // proper image ratio. Used in conjunction with product_thumb.php t/n generator. function tep_image($src, $alt = '', $width = '', $height = '', $params = '') { // Set default image variable and code $image = '<img src="' . $src . '"'; // Don't calculate if the image is set to a "%" width if (strstr($width,'%') == false || strstr($height,'%') == false) { $dont_calculate = 0; } else { $dont_calculate = 1; } // Dont calculate if a pixel image is being passed (hope you dont have pixels for sale) if (!strstr($image, 'pixel')) { $dont_calculate = 0; } else { $dont_calculate = 1; } // Do we calculate the image size? if (CONFIG_CALCULATE_IMAGE_SIZE && !$dont_calculate) { // Get the image's information if ($image_size = @getimagesize($src)) { $ratio = $image_size[1] / $image_size[0]; // Set the width and height to the proper ratio if (!$width && $height) { $ratio = $height / $image_size[1]; $width = intval($image_size[0] * $ratio); } elseif ($width && !$height) { $ratio = $width / $image_size[0]; $height = intval($image_size[1] * $ratio); } elseif (!$width && !$height) { $width = $image_size[0]; $height = $image_size[1]; } // Scale the image if not the original size if ($image_size[0] != $width || $image_size[1] != $height) { $rx = $image_size[0] / $width; $ry = $image_size[1] / $height; if ($rx < $ry) { $width = intval($height / $ratio); } else { $height = intval($width * $ratio); } $image = '<img src="product_thumb.php?img=' . $src . '&w=' . tep_output_string($width) . '&h=' . tep_output_string($height) . '"'; } } elseif (IMAGE_REQUIRED == 'false') { return ''; } } // Add remaining image parameters if they exist if ($width) { $image .= ' width="' . tep_output_string($width) . '"'; } if ($height) { $image .= ' height="' . tep_output_string($height) . '"'; } if (tep_not_null($params)) $image .= ' ' . $params; $image .= ' border="0" alt="' . tep_output_string($alt) . '"'; if (tep_not_null($alt)) { $image .= ' title="' . tep_output_string($alt) . '"'; } $image .= '>'; return $image; }
bning Posted October 30, 2008 Posted October 30, 2008 From what I can tell your problem seems to come from the DIR_WS_IMAGES constant. It seems to be passed as the entire url rather than just the 'images/'. This is a bit odd as its defined in your config as 'define('DIR_WS_IMAGES', 'images/');' which is correct. In the example : tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif'); you send the following string to the tep_image function : 'images/checkout_bullet.gif' This is received by the function and placed into the $src variable. Now all the calculation gubbins is done in the function to get the width/height for the new image and then it builds up the url for the new images as : $image = '<img src="product_thumb.php?img=' . $src . '&w=' . tep_output_string($width) . '&h=' . tep_output_string($height) . '"'; So it simply inserts the $src into the above which should result in the html output example : <img src="product_thumb.php?img=images/checkout_bullet.gif&w=100&h=100"> However, what you are actually getting is : product_thumb.php?img=http://kiwiwebhost.fanconi.net.nz/~rapt/images/checkout_bullet.gif&w=100&h=100 So I can only think that your constant 'DIR_WS_IMAGES' is somehow incorrect. Recheck your config file to make sure the DIR_WS_IMAGES constant is correctly defined (in catalog/includes/configure.php). You can see what the DIR_WS_IMAGES value is by outputting it to somewhere on your index.php page. i.e. place the following somewhere on your page '<?php echo DIR_WS_IMAGES; ?>'. If it is infact wrong and its value is 'http://kiwiwebhost.fanconi.net.nz/~rapt/images/' rather than 'images/' then I can suggest a hack which will get it working again. Now I'm only a novice at all this PHP/oscommerce stuff so it's not a permanent solution and may not be recommended but it may get your site working again until you can fix it properly. Maybe even resubmit a new thread if it is indeed the DIR_WS_IMAGES that is borked. So only if the DIR_WS_IMAGES value is 'http://kiwiwebhost.fanconi.net.nz/~rapt/images/': in the html_output.php file, UNDER the line 'function tep_image($src, $alt = '', $width = '', $height = '', $params = '') {' place the following: if (substr($src, 0, 18) == 'http://kiwiwebhost') { $src = substr($src, 40); } This looks to see if 'http://kiwiwebhost' is in the $src variable, then chops off the wrong part leaving what should be the correct part. Again this is a temporary measure and your should try to get at the cause. Hope this helps.
rapt Posted October 31, 2008 Author Posted October 31, 2008 Hello I found that when I changed the 'DIR_WS_IMAGES', 'images/'); to 'DIR_WS_IMAGES', 'http://kiwiwebhost.fanconi.net.nz/~rapt/images/'); The images with spaces in them loaded. You checked the store when I changed it to http://kiwiwebhost.fanconi.net.nz/~rapt/images/. Sorry to confuse things. I have changed it back to 'DIR_WS_IMAGES', 'images/'); and when the store tries to generate an image is is not finding it at all. All I get is http:///product_thumb.php?img=images/1157base.jpg&w=100&h=74 The url is missing thats why I thought if I put the full address in 'DIR_WS_IMAGES' it would fix it. But it did not. I have gone through and installed the lastest version of on the fly image resizer but it did not fix it either. Any other ideas?
jhande Posted October 31, 2008 Posted October 31, 2008 Did you also check - admin\includes\configure.php to see if anything has changed? Wonder what would happen if you changed this - define('DIR_WS_IMAGES', 'images/'); to this - define('DIR_WS_IMAGES', '/images/'); or this - define('DIR_WS_IMAGES', './images/'); :huh: - :: Jim :: - - My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -
bning Posted October 31, 2008 Posted October 31, 2008 I'd suggest it's nothing to do with your images folder of the thumbnailer package. You say you didn't change anything before it went wonky? I'd get in touch with your host and ask them if they changed anything. I don't use the auto thumbnailer but I compared it to another site where its working : here The images it creates look like : src="product_thumb.php?img=images/products/necaccusynctouchscreenmonitor-63.jpg&w=92&h=100" Yours like this: src="product_thumb.php?img=images/1156base.jpg&w=100&h=74" So apart from the image name and size it's the same. Pasting the following into a browser : http://ledbulbs.co.nz/product_thumb.php?img=images/1156base.jpg&w=100&h=74 displays a correctly resized image from your site. The only difference is when you right click a resized image on their site you get : http://www.tsunamihosting.com/catalog/product_thumb.php? as the address... On yours you get : http:///product_thumb.php?img=images/1156base.jpg&w=100&h=74 As the address. I have noticed that your site works PERFECTLY on Firefox. So you may like to post a new topic with a title something like 'Images work on Firefox but not IExplorer'. Thats sure you get people to see your thread (as lots of people hate IExplorer) :rolleyes: Sorry I can't be more help.
rapt Posted October 31, 2008 Author Posted October 31, 2008 Hello. Thanks for your help Its fixed. I just needed to add in the 'http://ledbulbs.co.nz' in to the part below. I didn't think it would matter if I was not using HTTPS. But it does. define('HTTPS_SERVER', 'http://ledbulbs.co.nz'); // eg, https://localhost - should not be empty for productive servers
Recommended Posts
Archived
This topic is now archived and is closed to further replies.