Jump to content



Photo
* * * * * 1 votes

'On The Fly' Auto Thumbnailer using GD Library 2.1


  • Please log in to reply
554 replies to this topic

#521   tokyoracer

tokyoracer
  • Members
  • 22 posts
  • Real Name:Trisha
  • Gender:Female
  • Location:New York

Posted 13 May 2009 - 12:35

sorry, I though u knew what u were doing!!

put back your original function, renaming it to tep_image_original

then put

if (substr($src, -4) == '.swf') return tep_image_original ($src, $alt, $width, $height, $params);

at the start of the new function


Hmmmm, this is going to need a little tweak -

The swf file "thumbs" are showing up just fine now, but on any pages that display them, i get a momentary flash of white and then the page loads. It seems as though ALL the images are getting parsed again. In Firefox, it only seems to occur on pages with swf - and in IE it happens on every page.

So close and yet...yet....

Any thoughts? Thanks so much!

#522   tokyoracer

tokyoracer
  • Members
  • 22 posts
  • Real Name:Trisha
  • Gender:Female
  • Location:New York

Posted 13 May 2009 - 13:46

Hmmmm, this is going to need a little tweak -

The swf file "thumbs" are showing up just fine now, but on any pages that display them, i get a momentary flash of white and then the page loads. It seems as though ALL the images are getting parsed again. In Firefox, it only seems to occur on pages with swf - and in IE it happens on every page.

So close and yet...yet....

Any thoughts? Thanks so much!


Methinks me has it! /laugh.gif' class='bbc_emoticon' alt=':lol:' />

In the OTF tep_image function I removed the tidbit you originally suggested:
if (substr($src, -4) == '.swf') return tep_image_original ($src, $alt, $width, $height, $params);

moved it further down - to change this:

// 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 . '&amp;w=' .                tep_output_string($width) . '&amp;h=' . tep_output_string($height) . '"';            }        } elseif (IMAGE_REQUIRED == 'false') {            return '';        }    }

to this:

// 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);                }            if (substr($src, -4) == '.swf') $image = '<embed src="' . $src . '"';             } else {                $image = '<img src="product_thumb.php?img=' . $src . '&amp;w=' .                tep_output_string($width) . '&amp;h=' . tep_output_string($height) . '"';            }        } elseif (IMAGE_REQUIRED == 'false') {            return '';        }    }

Initial testing seems to show that it covers all the bases and I don't even need to use the tep_image_original!

swf files seem to be resizing/displaying properly, regular images seem to be thumnailing properly, and there doesn't seem to be the white flash of blank page while the images reload.

~ Fingers crossed ~

Sam, I could have never done it without you giving me that snippet! Thanks a million!

Now, I'm still having an issue with IE - it reloads the images on EVERY page and I don't think it has anything to do with the OTF Thumbnailer. I uploaded a stock html_output file and it behaves the same way. I guess that's for another thread.

Thank you Sam again - I'll let you know if it blows up!

#523   tokyoracer

tokyoracer
  • Members
  • 22 posts
  • Real Name:Trisha
  • Gender:Female
  • Location:New York

Posted 13 May 2009 - 14:32

Methinks me has it! /laugh.gif' class='bbc_emoticon' alt=':lol:' />

Aw, gee, I spoke too soon - once I cleared my cache the thumbnails ARE NOT displaying properly - ARGHHH!!

I think I'm on the right track though - maybe switching the order....

Sam, your original idea worked just fine except for that "iimage reloading thing"

OK, I'm gonna go drown my sorrows in a pint of ice cream and come back to this later.....

As always, thanks for your time -

#524   tokyoracer

tokyoracer
  • Members
  • 22 posts
  • Real Name:Trisha
  • Gender:Female
  • Location:New York

Posted 13 May 2009 - 19:15

Aw, gee, I spoke too soon - once I cleared my cache the thumbnails ARE NOT displaying properly - ARGHHH!!

I think I'm on the right track though - maybe switching the order....

Sam, your original idea worked just fine except for that "iimage reloading thing"

OK, I'm gonna go drown my sorrows in a pint of ice cream and come back to this later.....

As always, thanks for your time -


Ok, I may be drunk with sugar but i think I may really have it this time - I ended up with this modification in the OTC tep_image function:

// 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 . '&amp;w=' .                tep_output_string($width) . '&amp;h=' . tep_output_string($height) . '"';                      if (substr($src, -4) == '.swf') $image = '<embed src="' . tep_output_string($src) . '"';            }         } elseif (IMAGE_REQUIRED == 'false') {            return '';        }    }

It seems to be working for now - I'll let ya know!

/blink.gif' class='bbc_emoticon' alt=':blink:' />

#525   cthullhu

cthullhu
  • Members
  • 32 posts
  • Real Name:Duncan

Posted 16 July 2009 - 03:46

Hi, all. I did an install of version 2.4 fix 4, and it works, but now when you click to enlarge the image you get the same image. I saw a post about this earlier, but no fix. Anyone know where the error is?

#526   cthullhu

cthullhu
  • Members
  • 32 posts
  • Real Name:Duncan

Posted 18 July 2009 - 03:13

Don't tell me this is a dead contribution? ANYONE?

#527   dave.hugo

dave.hugo
  • Members
  • 2 posts
  • Real Name:David Hugoson
  • Gender:Male
  • Location:Sweden

Posted 08 September 2009 - 11:06

Hello!

When I go in on my index.php I get this message:

//// // Output a form radio field function tep_draw_radio_field($name, $value = '', $checked = false, $parameters = '') { return tep_draw_selection_field($name, 'radio', $value, $checked, $parameters); } //// // Output a form textarea field function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) { global $HTTP_GET_VARS, $HTTP_POST_VARS; $field =


What could be wrong?

This is my htmloutput.php:

<?php/* $Id: html_output.php,v 1.56 2003/07/09 01:15:48 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url] Copyright © 2003 osCommerce Released under the GNU General Public License*/////// The HTML href link wrapper function function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {  global $request_type, $session_started, $SID;  if (!tep_not_null($page)) {   die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>');  }  if ($connection == 'NONSSL') {   $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;  } elseif ($connection == 'SSL') {   if (ENABLE_SSL == true) {	$link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;   } else {	$link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;   }  } else {   die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>');  }  if (tep_not_null($parameters)) {   $link .= $page . '?' . tep_output_string($parameters);   $separator = '&';  } else {   $link .= $page;   $separator = '?';  }  while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1);// Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined  if ( ($add_session_id == true) && ($session_started == true) && (SESSION_FORCE_COOKIE_USE == 'False') ) {   if (tep_not_null($SID)) {	$_sid = $SID;   } elseif ( ( ($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL == true) ) || ( ($request_type == 'SSL') && ($connection == 'NONSSL') ) ) {	if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) {	 $_sid = tep_session_name() . '=' . tep_session_id();	}   }  }  if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) {   while (strstr($link, '&&')) $link = str_replace('&&', '&', $link);   $link = str_replace('?', '/', $link);   $link = str_replace('&', '/', $link);   $link = str_replace('=', '/', $link);   $separator = '?';  }  if (isset($_sid)) {   $link .= $separator . tep_output_string($_sid);  }  return $link; }////// "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; }/* // The HTML image wrapper function function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') {  if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) {   return false;  }// alt is added to the img tag even if it is null to prevent browsers from outputting// the image filename as default  $image = '<img src="' . tep_output_string($src) . '" border="0" alt="' . tep_output_string($alt) . '"';  if (tep_not_null($alt)) {   $image .= ' title=" ' . tep_output_string($alt) . ' "';  }  if ( (CONFIG_CALCULATE_IMAGE_SIZE == 'true') && (empty($width) || empty($height)) ) {   if ($image_size = @getimagesize($src)) {	if (empty($width) && tep_not_null($height)) {	 $ratio = $height / $image_size[1];	 $width = $image_size[0] * $ratio;	} elseif (tep_not_null($width) && empty($height)) {	 $ratio = $width / $image_size[0];	 $height = $image_size[1] * $ratio;	} elseif (empty($width) && empty($height)) {	 $width = $image_size[0];	 $height = $image_size[1];	}   } elseif (IMAGE_REQUIRED == 'false') {	return false;   }  }  if (tep_not_null($width) && tep_not_null($height)) {   $image .= ' width="' . tep_output_string($width) . '" height="' . tep_output_string($height) . '"';  }  if (tep_not_null($parameters)) $image .= ' ' . $parameters;  $image .= '>';  return $image; }*/////// The HTML form submit button wrapper function// Outputs a button in the selected language function tep_image_submit($image, $alt = '', $parameters = '') {  global $language;  $image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '" border="0" alt="' . tep_output_string($alt) . '"';  if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';  if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;  $image_submit .= '>';  return $image_submit; }////// Output a function button in the selected language function tep_image_button($image, $alt = '', $parameters = '') {  global $language;  return tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image, $alt, '', '', $parameters); }////// Output a separator either through whitespace, or with an image function tep_draw_separator($image = 'pixel_black.gif', $width = '100%', $height = '1') {  return tep_image(DIR_WS_IMAGES . $image, '', $width, $height); }////// Output a form function tep_draw_form($name, $action, $method = 'post', $parameters = '') {  $form = '<form name="' . tep_output_string($name) . '" action="' . tep_output_string($action) . '" method="' . tep_output_string($method) . '"';  if (tep_not_null($parameters)) $form .= ' ' . $parameters;  $form .= '>';  return $form; }////// Output a form input field function tep_draw_input_field($name, $value = '', $parameters = '', $type = 'text', $reinsert_value = true) {  $field = '<input type="' . tep_output_string($type) . '" name="' . tep_output_string($name) . '"';  if ( (isset($GLOBALS[$name])) && ($reinsert_value == true) ) {   $field .= ' value="' . tep_output_string(stripslashes($GLOBALS[$name])) . '"';  } elseif (tep_not_null($value)) {   $field .= ' value="' . tep_output_string($value) . '"';  }  if (tep_not_null($parameters)) $field .= ' ' . $parameters;  $field .= '>';  return $field; }////// Output a form password field function tep_draw_password_field($name, $value = '', $parameters = 'maxlength="40"') {  return tep_draw_input_field($name, $value, $parameters, 'password', false); }////// Output a selection field - alias function for tep_draw_checkbox_field() and tep_draw_radio_field() function tep_draw_selection_field($name, $type, $value = '', $checked = false, $parameters = '') {  $selection = '<input type="' . tep_output_string($type) . '" name="' . tep_output_string($name) . '"';  if (tep_not_null($value)) $selection .= ' value="' . tep_output_string($value) . '"';  if ( ($checked == true) || ( isset($GLOBALS[$name]) && is_string($GLOBALS[$name]) && ( ($GLOBALS[$name] == 'on') || (isset($value) && (stripslashes($GLOBALS[$name]) == $value)) ) ) ) {   $selection .= ' CHECKED';  }  if (tep_not_null($parameters)) $selection .= ' ' . $parameters;  $selection .= '>';  return $selection; }////// Output a form checkbox field function tep_draw_checkbox_field($name, $value = '', $checked = false, $parameters = '') {  return tep_draw_selection_field($name, 'checkbox', $value, $checked, $parameters); }////// Output a form radio field function tep_draw_radio_field($name, $value = '', $checked = false, $parameters = '') {  return tep_draw_selection_field($name, 'radio', $value, $checked, $parameters); }////// Output a form textarea field function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) {  $field = '<textarea name="' . tep_output_string($name) . '" wrap="' . tep_output_string($wrap) . '" cols="' . tep_output_string($width) . '" rows="' . tep_output_string($height) . '"';  if (tep_not_null($parameters)) $field .= ' ' . $parameters;  $field .= '>';  if ( (isset($GLOBALS[$name])) && ($reinsert_value == true) ) {   $field .= tep_output_string_protected(stripslashes($GLOBALS[$name]));  } elseif (tep_not_null($text)) {   $field .= tep_output_string_protected($text);  }  $field .= '</textarea>';  return $field; }////// Output a form hidden field function tep_draw_hidden_field($name, $value = '', $parameters = '') {  $field = '<input type="hidden" name="' . tep_output_string($name) . '"';  if (tep_not_null($value)) {   $field .= ' value="' . tep_output_string($value) . '"';  } elseif (isset($GLOBALS[$name])) {   $field .= ' value="' . tep_output_string(stripslashes($GLOBALS[$name])) . '"';  }  if (tep_not_null($parameters)) $field .= ' ' . $parameters;  $field .= '>';  return $field; }////// Hide form elements function tep_hide_session_id() {  global $session_started, $SID;  if (($session_started == true) && tep_not_null($SID)) {   return tep_draw_hidden_field(tep_session_name(), tep_session_id());  } }////// Output a form pull down menu function tep_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false) {  $field = '<select name="' . tep_output_string($name) . '"';  if (tep_not_null($parameters)) $field .= ' ' . $parameters;  $field .= '>';  if (empty($default) && isset($GLOBALS[$name])) $default = stripslashes($GLOBALS[$name]);  for ($i=0, $n=sizeof($values); $i<$n; $i++) {   $field .= '<option value="' . tep_output_string($values[$i]['id']) . '"';   if ($default == $values[$i]['id']) {	$field .= ' SELECTED';   }   $field .= '>' . tep_output_string($values[$i]['text'], array('"' => '"', '\'' => ''', '<' => '<', '>' => '>')) . '</option>';  }  $field .= '</select>';  if ($required == true) $field .= TEXT_FIELD_REQUIRED;  return $field; }////// Creates a pull-down list of countries function tep_get_country_list($name, $selected = '', $parameters = '') {  $countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));  $countries = tep_get_countries();  for ($i=0, $n=sizeof($countries); $i<$n; $i++) {   $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']);  }  return tep_draw_pull_down_menu($name, $countries_array, $selected, $parameters); }?>

I hope someone could help me..

Edited by dave.hugo, 08 September 2009 - 11:08.


#528   bryansgeneralstore

bryansgeneralstore
  • Members
  • 3 posts
  • Real Name:bryan

Posted 11 April 2010 - 03:54

ok well i have installed this contrib. and it is gread except on my product listing page the thumbnails are not showing right at all.
for some reason it is making some random size thumbnail. and puts it in just on that one page. all of my other thumbs are working ok.
i have been trying to sort this problem myself but am not getting anywhere. if i change the html_output file in catalog side the picture on my product listing page goes to almost full size but i cannot figure out where it is doing it. Thanks in advance for any help

#529   fuzioneer

fuzioneer
  • Members
  • 148 posts
  • Real Name:Dave
  • Gender:Male

Posted 10 September 2010 - 10:21

got this up and running, but some of my images which have very small category images are being displayed with black borders

see this page for an example: http://www.outdoorbi...n-kit-p-38.html

It is caused by the thumbnailer increasing the size of the image to the standard size and filling the extra stretched space with black colour.

My Question is how do i change the filled space to be white instead of black ?

#530   timmer81

timmer81
  • Members
  • 68 posts
  • Real Name:Tim

Posted 30 October 2010 - 20:14

I posted a cry for help on another auto thumbnailer thread but wasn't sure if that was the right one.

The contribution is fab the thumbnails look great and works well. My problem is that when in the admin area all the buttons for 'add new product' 'add category' delete product etc are missing and cannot edit add move anything.

if someone can please help me that would be great.

Thanks in advance.

Timmer

#531   pleasureidea

pleasureidea
  • Members
  • 28 posts
  • Real Name:Oleg Gladkiy

Posted 10 February 2011 - 04:01

The problem happens when image is not loaded using regular way via admin add new product but when you upload products in bulk using CSV loader.
Images like 123+3+3.jpg will not showed as thumbnail. The regular 123+3+3.jpg image exists and when you click on thumbnail it will pop up. Looks like the problem appears only when pluses are in the file name. All other pictures seems to be shown correctly. If you go than and reload the image using admin edit product function, the thumbnail appears.

Anybody know how to fix the problem? Please help as now many of my thumbnail pictures with pluses are not shown /sad.gif' class='bbc_emoticon' alt=':(' />

#532   DAVID3733

DAVID3733
  • Members
  • 162 posts
  • Real Name:DAVID
  • Location:essex UK

Posted 02 June 2011 - 14:33

Hi there

Have installed 2.4 on oscommerce 2.3.1 and mostly seems to be working but the products page doesnt seem to work as thunmbnail, i have seen comments on editing products_info.php direct but these are directed for use of 2 images rather than on the fly thumbnailer, does anybody know what the fix is

i belive the code refred to is

<script type="text/javascript">
$('#piGal ul').bxGallery({
  maxwidth: 80,
  maxheight: 100,
  thumbwidth: <?php echo (($pi_counter > 1) ? '75' : '0'); ?>,
  thumbcontainer: 100,
  load_image: 'ext/jquery/bxGallery/spinner.gif'
});
</script>

any assistance would be appriciated

thank you

David
David

#533   cujimmy

cujimmy
  • Members
  • 63 posts
  • Real Name:Jimmy Powdrell Campbell
  • Gender:Male
  • Location:Glasgow, Scotland

Posted 23 July 2011 - 21:01

Great contrib! If anyone using an admin-configurable version has to change the configuration_group_id from 100 in the SQL file don't forget (as I did) to change it in the query at line 21 in catalog/product_thumb.php or you'll get an arty-farty cubist thumbnail image compressed right down to zero quality. On the plus side, you get a nice quick download with a file size of under 1KB /whistling.gif' class='bbc_emoticon' alt=':-"' />

#534   willce20

willce20
  • Members
  • 6 posts
  • Real Name:Wilfredo Cerrato

Posted 04 August 2011 - 16:02

HOW DO YOU UNINSTALL THUMBNAILER?
/huh.gif' class='bbc_emoticon' alt=':huh:' />

UNINSTALL THUMBNAILER?!!?!!

#535   DAVID3733

DAVID3733
  • Members
  • 162 posts
  • Real Name:DAVID
  • Location:essex UK

Posted 16 August 2011 - 15:16

I installed this great product a few years ago, not sure which version i have but can cache images, and have thumbnails/ dir

I have it istalled on a multi store set up with 1 images folder on the 1st store and the other stores get there images from that main store images folder

All has been working great for a number of years but last week moved all the sites onto a new faster server, everything in main store is working as it should but the other stores are not, i know the shared images folder is working ok as its getting some images direct like header images that go direct to images folder. Unfortunatlty the product images will not.

if i force images required in Admin configuration/images image required = false then it will download the full version of the product image, ie one that is not the thumbnail and none of the category images, if i switch off image required it will not download the product image

have messed about with configure.php but not got anywhere, i guess its going to be something minor with the path but i have come back to this 3 or 4 times now not sussed it yet, anypointers would be appriciated

thank you

David
David

#536   DAVID3733

DAVID3733
  • Members
  • 162 posts
  • Real Name:DAVID
  • Location:essex UK

Posted 17 August 2011 - 09:06

I am slowly making headway, did have a couple of path issues which i think have now been eradicated, it is very strange as it was all working fine on the last server

in product_info.php i get


document.write('<a href="javascript:popupWindow(\'http://www.domain.co.uk/popup_image.php?pID=20501\')"><br>Click to enlarge</a>'); 
  
//--></script> <noscript> <a href="http://www.domain.co.uk/images/CS-P240CL.jpg" target="_blank"><br>Click to enlarge</a></noscript> <TR><td align="center" class="main"><input type="hidden" name="products_id" 


but should get something like (which is what i get on main site (they are different products )


document.write('<a href="javascript:popupWindow(\'http://www.domain.com/ajustable-shower-head-rose-pi-3648.html\')"><img src="product_thumb.php?img=images/Showerheadmassagebig.jpg&w=100&h=80" width="100" height="80" border="0" alt="Ajustable Shower head (rose)" title="Ajustable Shower head (rose)"><br>Click to enlarge</a>'); 
  
//--></script> <noscript> <a href="http://www.domain.com/images/Showerheadmassagebig.jpg" target="_blank"><img src="product_thumb.php?img=images/Showerheadmassagebig.jpg&w=100&h=80" width="100" height="80" border="0" alt="Ajustable Shower head (rose)" title="Ajustable Shower head (rose)"><


I have ensured that products_thumb.php and the includes/function/html_output.html wrapper is the same (i think)

any pointers about where to look next would be appriciated

thank you
David

#537   psdealer

psdealer
  • Members
  • 29 posts
  • Real Name:psdealer

Posted 15 September 2011 - 07:58

hello everyone,
I have CPU consuming problem with this addon.

OSC: 2.2RC2
Addon: otf_autoThumb_v2-4fix3
Server: 2x Intel® Core™2 Duo CPU E6550 @ 2.33GHz

These days my website has daily 3000-5000 visitors, comonly 150-300 visitors online at the same time.
I received email from hosting company, it said the cpu has been maxed out.
They and me both find that the CPU big consuming is product_thumb.php

I don't know why this addon consume so much CPU, have any way to optimize it?
Need help!!!

#538   jps001

jps001
  • Members
  • 44 posts
  • Real Name:Jasper Tielen

Posted 30 September 2011 - 07:16

Hello,

I have a error log problem and one of the main problems is this
PHP Notice: Undefined variable: filename in /var/www/vhosts/***/product_thumb.php on line 276
PHP Notice: Undefined variable: filename in /var/www/vhosts/***/product_thumb.php on line 327

The lines 276 and 327 are:
[codebox]
276 if (file_exists($filename) && $tn_server_cache && filemtime($filename) > filemtime($_GET['img'])
327 $tmp_path = str_replace(basename($filename), '', $filename);
[/codebox]

Both for cache and someone told me a few weeks ago the generated thumbnail whas not recalled even when it whas a old image that was looked up a lot more times.

Please help me out

Regards,

jasper

#539   KaiAnimation

KaiAnimation
  • Members
  • 116 posts
  • Real Name:Danny White
  • Location:So California

Posted 03 October 2011 - 04:09

Recently I replaced my old, heavily modified Mile Stone 2 store with 2.3.1. I wanted some of the same contributions that I had installed 4-5 years ago. I installed 'On The Fly' Auto Thumbnailer and my thumbnails wouldn't display. I just saw the alt text as a link and the product title as a link. The thing that fixed my trouble was replacing the code in catalog/product_thumb.php with the code in this post:
http://forums.oscomm...&gopid=1188192

I also found problems in my catalog\includes\functions\html_output.php because my html editor turned two & into &amp; and | into |, which is a pipe, or vertical bar.

It was interesting to see my HTML editor screwing up, but fixing html_output.php with notepad still didn't display my thumbnails, the code in the link did.

Danny
If I'm giving advice, it is based on what path I would take to fix your problem. My path may be wrong.

#540   yansfung

yansfung
  • Members
  • 66 posts
  • Real Name:Yan, SY FUNG
  • Gender:Male
  • Location:Hong Kong

Posted 02 January 2012 - 09:46

I am a "green boy".

A stupid question, I have installed this addon . How's work? I mean how to kick it off?
YaNotCook !!