Jump to content



Photo
* * * * * 3 votes

[Contribution] oscThumb


  • Please log in to reply
443 replies to this topic

#421   jonesy827

jonesy827
  • Members
  • 19 posts
  • Real Name:Michael Jones

Posted 08 July 2011 - 17:33

Hi, I'm having some trouble with oscThumb. It is working and generating the thumbnails perfectly. I'm just having one problem. If it is generating images on a page and I do not let it finish (takes awhile), I will get an Internal Server Error 500. It will show this error on all pages until it is done generating the images.

Is there any way around this? I have caching turned on but it still wants to generate images almost every time.

We use 1&1 shared hosting. You can view the site at scopestop.com

#422   jonesy827

jonesy827
  • Members
  • 19 posts
  • Real Name:Michael Jones

Posted 09 July 2011 - 20:30

I was not able to edit my post, but just wanted to say I got the issue resolved. I simply switched to otf autothumb which uses GD version 2, which I think may have been the issues.

#423   Roaddoctor

Roaddoctor
  • Members
  • 1,055 posts
  • Real Name:David Jennings
  • Gender:Not Telling
  • Location:Texas

Posted 27 July 2011 - 15:17

I had similar phpThumb no image showing issues.... Try setting all the JPEG QUALITY settings to 100, then test. Once I did this the missing images began appearing again, then I was able to re-set the quality any other varables without issue. Odd, but worked for me.

oscThumb 1.12 with the core phpThumb 1.7.10 update applied, on mysql5/php5 server. 2.2Rc2a
-Dave

#424   ntls2000

ntls2000
  • Members
  • 5 posts
  • Real Name:Chris

Posted 07 August 2011 - 20:30

Hi,

i have installed oscthumbs on my oscommerce 2.3.1

i have a problem with popup , there is no watermarks.

Any ideas ?

#425   blueedge

blueedge
  • Members
  • 148 posts
  • Real Name:Keith

Posted 20 August 2011 - 02:38

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?


Also, in the July 20, 2011 update to the contribution, it states:

phpThumb has an exploit command vulnerability.
I just took the last phpThumb 1.7.10
and update accordingly to the doc prodided :

catalog/phpThumb/phpThumb.php: set the error reporting to (E_ERROR | E_PARSE) instead of E_ALL.
catalog/phpThumb/phpThumb.config.php: the following parameters have been modified:

$PHPTHUMB_CONFIG['document_root']: from osCommerce constant
$PHPTHUMB_CONFIG['cache_directory']: from configuration parameter
$PHPTHUMB_CONFIG['high_security_password']: from configuration parameter

You should replace your current version of phpThumb with the one provided in the zip file.


Does the entire contribution need to be updated or just the two files mentioned? Are there changes to other files than the ones listed?

Thanks.

#426   tintin192

tintin192
  • Members
  • 1 posts
  • Real Name:Mat
  • Gender:Male

Posted 23 September 2011 - 15:59

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 -->


#427   velvetpixel

velvetpixel
  • Members
  • 124 posts
  • Real Name:Cameron

Posted 24 September 2011 - 03:24

How can I make the & in urls generated by oscthumb be &amp; so my pages pass validation?

#428   velvetpixel

velvetpixel
  • Members
  • 124 posts
  • Real Name:Cameron

Posted 25 September 2011 - 19:18

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;
  }


#429   velvetpixel

velvetpixel
  • Members
  • 124 posts
  • Real Name:Cameron

Posted 27 September 2011 - 21:58

Is there a way to clear the cache from the admin or do I need to clear out the contents of phpThumb/cache manually?

#430   hooiyijun

hooiyijun
  • Members
  • 1 posts
  • Real Name:Jun

Posted 24 November 2011 - 09:12

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

#431   mcollina

mcollina
  • Members
  • 12 posts
  • Real Name:Marcelo
  • Gender:Male

Posted 23 January 2012 - 02:27

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

#432   nielss

nielss
  • Members
  • 33 posts
  • Real Name:Niels

Posted 25 April 2012 - 13:48

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


#433   Brainbug125

Brainbug125
  • Members
  • 44 posts
  • Real Name:bob

Posted 25 April 2012 - 14:34

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

#434   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 25 April 2012 - 15:51

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.
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.

#435   Brainbug125

Brainbug125
  • Members
  • 44 posts
  • Real Name:bob

Posted 26 April 2012 - 00:01

Oky

I wait then
tx

#436   neetjedem

neetjedem
  • Members
  • 6 posts
  • Real Name:René de Meijer

Posted 08 June 2012 - 10:53

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.

#437   neetjedem

neetjedem
  • Members
  • 6 posts
  • Real Name:René de Meijer

Posted 08 June 2012 - 14:47

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.

#438   modem2.0

modem2.0
  • Members
  • 70 posts
  • Real Name:Modem 2.0

Posted 12 June 2012 - 18:08

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.

#439   neetjedem

neetjedem
  • Members
  • 6 posts
  • Real Name:René de Meijer

Posted 11 July 2012 - 19:11

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 by neetjedem, 11 July 2012 - 19:15.


#440   neetjedem

neetjedem
  • Members
  • 6 posts
  • Real Name:René de Meijer

Posted 11 July 2012 - 19:28

of course when I say "Then make a watermark.php with background transparency......" I mean watermark.png! Sorry.