tintin192 Posted September 23, 2011 Share Posted September 23, 2011 Hi Guys. We're using the contrib and it's working fine. Just recently, we've started to do some A/B testing using Google's Website Optimizer and we've found that OSCThumbs stops working properly on the 'variant page'. The contrib is continuing to work fine on the original page. The variant page is an exact copy of the original page, but with some Google script code just under the <head> tag. You can see this code below, but it's JS, and shouldn't have any effect on OscThumb. On the variant page, Oscthumb is failing to show the images as animated pop-ups, it just opens the images in new pages. Does Oscthumb have any settings that depend on the name of the page that the contrib appears on? Would changing this page make the settings not valid? One last thing - in FF Firebug, we see the following error $("div#fancy a").fancybox is not a function Clearly this is the problem, but *why* is fancybox not a function - it works just fine in the original page? Any help much appreciated.... Google Website Optimzer JS code below.... <!-- Google Website Optimizer Tracking Script --> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['gwo._setAccount', 'UA-xxxxxxxx-2']); _gaq.push(['gwo._trackPageview', '/xxxxxxxxxx/test']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> <!-- End of Google Website Optimizer Tracking Script --> Quote Link to comment Share on other sites More sharing options...
velvetpixel Posted September 24, 2011 Share Posted September 24, 2011 How can I make the & in urls generated by oscthumb be & so my pages pass validation? Quote osCommerce 2.3.1 Add-Ons Installed Header Tags SEO Ultimate SEO URLs Google Sitemap SEO Easy Populate QT Pro Margin Report AJAX Attribute Manager Smart Columns CKEditor OSCThumb Select Product Image Directory Category CSS Menu Enable Disable Categories Contact Form Captcha Link to comment Share on other sites More sharing options...
velvetpixel Posted September 25, 2011 Share Posted September 25, 2011 The kind people at the phpThumbs forums said I need to wrap htmlentities around the img src like this: echo '<img src="'.htmlentities('/phpThumb/phpThumb.php?src=/images/pic.jpg&w=50', ENT_QUOTES).'">'; echo '<img src="'.htmlentities(phpThumbURL('src=/images/pic.jpg&w=50', '&', '/phpThumb/phpThumb.php'), ENT_QUOTES).'">'; How do I do that for the osCommerce image code here: // The HTML image wrapper function function tep_image_original($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) . '" 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 = intval($image_size[0] * $ratio); } elseif (tep_not_null($width) && empty($height)) { $ratio = $width / $image_size[0]; $height = intval($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; } Quote osCommerce 2.3.1 Add-Ons Installed Header Tags SEO Ultimate SEO URLs Google Sitemap SEO Easy Populate QT Pro Margin Report AJAX Attribute Manager Smart Columns CKEditor OSCThumb Select Product Image Directory Category CSS Menu Enable Disable Categories Contact Form Captcha Link to comment Share on other sites More sharing options...
velvetpixel Posted September 27, 2011 Share Posted September 27, 2011 Is there a way to clear the cache from the admin or do I need to clear out the contents of phpThumb/cache manually? Quote osCommerce 2.3.1 Add-Ons Installed Header Tags SEO Ultimate SEO URLs Google Sitemap SEO Easy Populate QT Pro Margin Report AJAX Attribute Manager Smart Columns CKEditor OSCThumb Select Product Image Directory Category CSS Menu Enable Disable Categories Contact Form Captcha Link to comment Share on other sites More sharing options...
hooiyijun Posted November 24, 2011 Share Posted November 24, 2011 Hi, I met the problem that i cannot adjust watermark text to big. This look like the maximum point up to 5. This is because the people cannot see the small text. I readed the code from phpthumb.filters.php. The code shows in the following: Line 1178 $size = min(5, max(1, $size)); Although i hide the above code, but the watermark text is same, too small. I checked another place from phpthumb.filters.php. This look like the following code cause the watermark text image to be fixed. Line 1181 $text_width = 0; Line 1182 $text_height = 0; Line 1183 foreach ($textlines as $dummy => $line) { Line 1184 $text_width = max($text_width, ImageFontWidth($size) * strlen($line)); Line 1185 $text_height += ImageFontHeight($size); Line 1186 } I changed "$text_width = 0;" to "$text_width = 100;", and changed "$text_height = 0;" to "$text_height = 100;", the problem still same. The watermark text is too small to me. Anyone can solve this problem? I cannot clear what is wrong with the above code. Thanks, Jun Quote Link to comment Share on other sites More sharing options...
mcollina Posted January 23, 2012 Share Posted January 23, 2012 Hi... I've installed this modulo on osc 2.3.1 and I'm having this problem: Warning: require(includes/classes/oscthumb.php) [function.require]: failed to open stream: No such file or directory in /home/ambiancebijoux/www/catalogo_homolog/admin/includes/application_top.php on line 184 Warning: require(includes/classes/oscthumb.php) [function.require]: failed to open stream: No such file or directory in /home/ambiancebijoux/www/catalogo_homolog/admin/includes/application_top.php on line 184 Fatal error: require() [function.require]: Failed opening required 'includes/classes/oscthumb.php' (include_path='.:/usr/local/lib/php') in /home/ambiancebijoux/www/catalogo_homolog/admin/includes/application_top.php on line 184 SOmeone can helpme please? Tks Quote Link to comment Share on other sites More sharing options...
nielss Posted April 25, 2012 Share Posted April 25, 2012 I had a problem with: <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], '90', '90'); ?> That it was not reconizing the width and the height correctly. After debuging I found out that the $alt tag was missing in html_output. This is what you have to change: (around line 83 and 84) just add $alt right after $src $oscthumb->set_type ($src, $alt, $width, $height, $thumbnail_type); // Detect the type of image we are currently processing if ($oscthumb->set_size ($src, $alt, $width, $height)==false) return false; // Choose the displayed width and height of the image, and if display something Quote Link to comment Share on other sites More sharing options...
Brainbug125 Posted April 25, 2012 Share Posted April 25, 2012 I used OscThumb in my last 231 Test Osc and everything worked fine until.....it stopped to loads some images....dunno why. It stopped to resize images too. Only my problem? Think is a google problem but im not sure. Question is... Is there another contribution for osc 2.31 that works like OscThumb? OscThumb is really nice but maybe a lil outdated Quote My Add On for the Osc Community MMB-Manager (Modules,Menu,Boxes Manager) V. 1.0 for 2.31 Link to comment Share on other sites More sharing options...
spooks Posted April 25, 2012 Share Posted April 25, 2012 I have done a re-write, I'll release fairly soon, no-doubt before osC 2.4 is out, which it will also work with. Quote Sam Remember, What you think I ment may not be what I thought I ment when I said it. Contributions: Auto Backup your Database, Easy way Multi Images with Fancy Pop-ups, Easy way Products in columns with multi buy etc etc Disable any Category or Product, Easy way Secure & Improve your account pages et al. Link to comment Share on other sites More sharing options...
Brainbug125 Posted April 26, 2012 Share Posted April 26, 2012 Oky I wait then tx Quote My Add On for the Osc Community MMB-Manager (Modules,Menu,Boxes Manager) V. 1.0 for 2.31 Link to comment Share on other sites More sharing options...
neetjedem Posted June 8, 2012 Share Posted June 8, 2012 Did anyone ever got OscThumb and Lightbox on STS to work.?? I'm really curious about it. The OscThumb works perfect on any aspect accept for Lightbox popup images. I hope someone has a solution. Thx. Quote Link to comment Share on other sites More sharing options...
neetjedem Posted June 8, 2012 Share Posted June 8, 2012 Did anyone ever got OscThumb and Lightbox on STS to work.?? I'm really curious about it. The OscThumb works perfect on any aspect accept for Lightbox popup images. I hope someone has a solution. Thx. I think it has something to do with the includes\modules\sts_inc\product_info.php since there is the lightbox for sts configured but i dont know what en where to change. Quote Link to comment Share on other sites More sharing options...
modem2.0 Posted June 12, 2012 Share Posted June 12, 2012 Hi Sam, do you have any news regarding your re-write version? I'm testing the latest in osc 2.3.1 and I can't seem to put it to work, I've seen no image so far. It's working on my osc 2.2 shop though... Not sure what's different... if you need a beta tester let me know. Quote Link to comment Share on other sites More sharing options...
neetjedem Posted July 11, 2012 Share Posted July 11, 2012 (edited) I found the solution to make oscommerce + sts4.3.3 + oscThumb + lightbox with watermark in popup work!!!! I'm not a php-wizard so the solution might not be so nice but it works for me and i thought to share it. I found this script on B&T's Tips and Scripts (thanks very very much) and changed it just a little bit: <?php // this script creates a watermarked image from an image file - can be a .jpg .gif or .png file // where watermark.gif is a mostly transparent gif image with the watermark - goes in the same directory as this script // where this script is named watermark.php // call this script with an image tag // <img src="watermark.php?path=imagepath"> where path is a relative path from the document root - such as subdirectory/image.jpg $imagesource = $_SERVER['DOCUMENT_ROOT']."/".$_GET['path']; if (!file_exists($imagesource)) die(); $filetype = strtolower(substr($imagesource,strlen($imagesource)-4,4)); if($filetype == ".gif") $image = @imagecreatefromgif($imagesource); if($filetype == ".jpg") $image = @imagecreatefromjpeg($imagesource); if($filetype == ".png") $image = @imagecreatefrompng($imagesource); if (empty($image)) die(); $watermark = @imagecreatefrompng('watermark.png'); $imagewidth = imagesx($image); $imageheight = imagesy($image); $watermarkwidth = imagesx($watermark); $watermarkheight = imagesy($watermark); $startwidth = (($imagewidth - $watermarkwidth)/2); $startheight = (($imageheight - $watermarkheight)/2); imagecopy($image, $watermark, $startwidth, $startheight, 0, 0, $watermarkwidth, $watermarkheight); header("Content-type: image/jpeg"); imagejpeg($image); imagedestroy($image); imagedestroy($watermark); ?> This will be your watermark.php and save it in the root of your webshop. Then make a watermark.php with background transparency and text or graphic transparency 20-25. Save it as PNG8 (small file size) and upload it also in your root folder. Then in includes/modules/sts_inc/product_info.php find this (or something like it): $template_pinfo['product_popup']= '<a rel="lightbox" href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" title="'. $product_info['products_model'] . ' - '. $product_info['products_name'] .' | '. $manufacturer['manufacturers_name'] .'">'. $template_pinfo['imagesmall'] . '</a>'."\n"; and change to: $template_pinfo['product_popup']= '<a rel="lightbox" href="watermark.php?path=/images/' . $product_info['products_image'] . '" title="'. $product_info['products_model'] . ' - '. $product_info['products_name'] .' | '. $manufacturer['manufacturers_name'] .'">'. $template_pinfo['imagesmall'] . '</a>'."\n"; The bold printed text "$template_pinfo['product_popup']= '<a rel="lightbox" href="watermark.php?path=/images/' . $product_info['products_image'] ." is the key. And there it works. look for an example on http://www.gigaparts.nl (live shop!!) Good luck all! Edited July 11, 2012 by neetjedem Quote Link to comment Share on other sites More sharing options...
neetjedem Posted July 11, 2012 Share Posted July 11, 2012 of course when I say "Then make a watermark.php with background transparency......" I mean watermark.png! Sorry. Quote Link to comment Share on other sites More sharing options...
♥Stephan Gebbers Posted August 15, 2012 Share Posted August 15, 2012 I always thought that my smallest oscThumb Thumbnails could be a bit sharper. I figured out how to do that now. If you want to add a bit more sharpness to your thumbnails your can add $PHPTHUMB_DEFAULTS['fltr'] = array('usm|95'); to your /phpThumb/phpThumb.config.php where the amount can be 1-255 (80 is default if you don't add this line). Quote Link to comment Share on other sites More sharing options...
Armandios Posted April 25, 2013 Share Posted April 25, 2013 Dear OscThumb user, We are using Oscommerce for our automotive blog. The contribution works well but we have another extra images contribution installed ( http://addons.oscommerce.com/info/1289 ) When we activate the OscThumb everything is cached well but the extra images from this contributions are not visible anymore Do we need to change something at the extra images contribution to made this OSCThumb work well for the extra images. Many thanks for anyone who can tell us what to do. The extra image code is here: <?php /* osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerce Released under the GNU General Public License Based on Extra images 1.4 from Mikel Williams Thanks to Mikel Williams, StuBo, moosey_jude and Randelia Modifications: Xav xpavyfr@yahoo.fr */ $products_extra_images_query = tep_db_query("SELECT products_extra_image, products_extra_images_id FROM " . TABLE_PRODUCTS_EXTRA_IMAGES . " WHERE products_id='" . $product_info['products_id'] . "'"); if (tep_db_num_rows($products_extra_images_query) >= 1){ $rowcount_value=1; //number of extra images per row $rowcount=1; ?><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <TR> <TD> <table width="10%" border="0" cellpadding="0" cellspacing="2"> </table> <table width="10" border="0" align="center" cellpadding="0" cellspacing="2"> <TR> <?php //$products_extra_images_query = tep_db_query("SELECT products_extra_image, products_extra_images_id FROM " . TABLE_PRODUCTS_EXTRA_IMAGES . " WHERE products_id='" . $product_info['products_id'] . "'"); while ($extra_images = tep_db_fetch_array($products_extra_images_query)) { ?> <td align ="center" width="10%"> <?php echo tep_image(DIR_WS_IMAGES . $extra_images['products_extra_image'], addslashes($product_info['products_name']), DIR_WS_IMAGES . $extra_images['products_extra_image'] . "'\"" ) . '<br><BR>'; ?></td> <?php if ($rowcount == $rowcount_value){echo '</tr><tr>'; $rowcount=1;} else {$rowcount=$rowcount+1;} } ?> </tr> </TABLE> </td> </tr> <?php } ?> Quote Link to comment Share on other sites More sharing options...
jraiche Posted January 7, 2014 Share Posted January 7, 2014 I wanted to extend the functionality of oscThumb to use hard-coded images or any images I wanted. I built a slideshow that grabbed random product images from my store and displayed them (using file size logic to remove things that were too small). Some images are too big though, and I wanted to reduce the size. The code I came up with seems to allow you to use oscThumb to generate css background-images, or any other image that you just want the URL for, much like Sir K.O. mentioned a looong time ago. Also got a little Problem.... I have hardcoded images in my descriptions. To thumbnail them too i tried to call them like this src="http://www.domain.com/oscthumb.php?src= I put this code into description with str_replace by replacing the original <img src=" with above code. Unfortunetaly it doenst work because of the hash! anyone has any solution on how to thumb this images without having an hash? or any other way? My solution: $picture1 = tep_image('images/your_image_name_or_other_image_identifier','', '500px',''); $picture1 = substr($picture1, 10, -46); Then when you want to call it: /* This is CSS */ background-image:url('<?php echo $picture1 ?>') It's not really that hard, but took me hours to figure out. You don't need to hash the image name or anything - it's all done automatically. All my code does is cut off the first 10 and last 46 characters of what tep_image with oscThumb generates. Of course, you can pass along any parameters you want. jraiche Quote Link to comment Share on other sites More sharing options...
MikeMike Posted June 16, 2014 Share Posted June 16, 2014 (edited) Since installing oscThumb, it seems that images are very slow to load. Does anyone have any suggestions how I can make the images load faster? Could there be some type of setting I overlooked? (Old post I know, but the slow image loads have been an issue for many here) Try this: In phpthumb.config.php set these three options to null $PHPTHUMB_CONFIG['cache_maxage'] = null; // never delete cached thumbnails based on last-access time $PHPTHUMB_CONFIG['cache_maxsize'] = null; // never delete cached thumbnails based on byte size of cache directory $PHPTHUMB_CONFIG['cache_maxfiles'] = null; // never delete cached thumbnails based on number of cached files I beleive what it does is keeping oscthumb from checking all your cached images every time an image is loaded. It made a huge difference for me. EDIT: I'm not sure at what point the image cache is renewed, if it is only done using cache_maxage or if it somewhere is reneved based on the cached image creation date. If it's only done based on cache_maxage, then the above may not be such a good idea. Edited June 16, 2014 by MikeMike Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.