Jump to content



Latest News: (loading..)

* * * * * 1 votes

'On The Fly' Auto Thumbnailer using GD Library 2.1


  • Please log in to reply
551 replies to this topic

#541   lildog

lildog
  • Members
  • 612 posts
  • Real Name:Todd
  • Gender:Male
  • Location:Sunny Florida

Posted 13 April 2012 - 10:12 PM

I have used this contrib in a few stores and it worked flawlessly. A clients server just upgraded the php software so I did an update to fix some errors and assumed it would fix the thumbs, but it didn't.

My thumbs are not generating, I do not get any errors, and when I view the image the path is correct(http://www.duds4buds.com/product_thumb.php?img=images/Golden-bears_GH.jpg&w=110&h=71) but I just get a path in the browser window instead of a image.

I hope someone can shed some light on my problem,
Todd

#542   spooks

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

Posted 13 April 2012 - 10:57 PM

I have done a re-write around this, partly as some of the code is bugged but also its very slow on shared servers with processor limits as it requires a new dBase connection for every image.

If there's enough interest I could create a new add-on around that, it would not have all the features of this though.

Given the issues with this I`m not sure its worth de-bugging
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.

#543   lildog

lildog
  • Members
  • 612 posts
  • Real Name:Todd
  • Gender:Male
  • Location:Sunny Florida

Posted 14 April 2012 - 12:44 AM

Do you know what the issues are off hand? I am not really worried about speed, right now, I just need to get the images working. Is it to do with the upgrade to php 5.3.x?

I also found that the thumbs are being generated just not shown.

Thank you for your time,
Todd

#544   spooks

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

Posted 14 April 2012 - 12:55 AM

Sorry, it was some time ago I don't remember exactly what, but yes some were to do with display. I ended up scrapping the original and wrote new code.
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.

#545   lildog

lildog
  • Members
  • 612 posts
  • Real Name:Todd
  • Gender:Male
  • Location:Sunny Florida

Posted 14 April 2012 - 12:33 PM

I also now remember I had an issue with it on the same shop a number of month's ago and was able to fix it. I was unable/unwilling to find the problem this morning and scrapped the contrib. For anyone that views this in the future what (if any) contrib do you recommend for thumbnailing?

Todd

#546 ONLINE   toyicebear

toyicebear
  • Community Sponsor
  • 6,058 posts
  • Real Name:Nick
  • Location:World Citizen

Posted 14 April 2012 - 01:16 PM

This one works ok...but dont use the TimThumb version....

You can for instance use this version: DJStealth 7 Sep 2008

And update the thumbfile with this one: mauriziomagnino 11 Feb 2011

Edited by toyicebear, 14 April 2012 - 01:18 PM.

Basics for osC 2.2 Design - Basics for Design V2.3+ - Seo & Sef Url's - Meta Tags for Your osC Shop - Steps to prevent Fraud... - MS3 and Team News... - SEO, Meta Tags, SEF Urls and osCommerce

Check out my profile [click here] for information on professional services, custom coding, templates, SEO optimization, modifications, commercial support and help.

#547   xvoyance

xvoyance
  • Members
  • 87 posts
  • Real Name:xi voyance
  • Gender:Male

Posted 19 April 2012 - 03:33 AM

I installed v3 for osc 2.3.1
Strangely, the line
if (!is_file($src)) {  $src = "../images/no_image.jpg"; }
at html_output.php, under catalog/admin/includes/functions, made all my products images
disappear. Removing this line the images comes back.

The banner on the left top is intacted.

This means the test for $src is not a file. Why?

My programs are shown

http://pastebin.com/JY98xfqk (html_output.php)

http://pastebin.com/PLTM9KuV (categories.php)

#548   dtaquarium

dtaquarium
  • Members
  • 55 posts
  • Real Name:tom

Posted 29 April 2012 - 04:38 PM

Hi
I have everything working except on th procuct info page..anyone know where to look to fix that.

Thanks
Tom

#549   mpalasis

mpalasis
  • Members
  • 24 posts
  • Real Name:Makis Palasis

Posted 02 May 2012 - 02:50 PM

I'm using otfAutoThumb-v3.0-for-2.3.1 http://addons.oscommerce.com/info/8104 (nobodyfamous 27 Jul 2011)


I made some modification to product_thumb.php :
  • block '..' in paths,
  • lock users into the DIR_WS_IMAGES folder,
  • make variable names clearer,
  • simpler modify_tn_path,
  • remove unneeded calls to modify_tn_path()
The end result can be used on both the catalog and the admin side w/o change.

Source: product_thumb.php

This change might be needed on the admin includes/functions/html_output.php:
inside tep_image()

change
	// Get the image's information
	if ($image_size = @getimagesize($src)) {
to
	$FS_img = $src;
	if (!is_readable($FS_img))
	$FS_img = DIR_FS_CATALOG . $FS_img;
	// Get the image's information
	if ($image_size = @getimagesize($FS_img)) {

Feedback/advice on my changes would be very welcome.

cheers.


One reservation: My test environment currently has '/' as catalog ( define('DIR_WS_HTTP_CATALOG', '/') )
so this may need some minor tuning to work for other locations, however I *think* it should work as-is. Please let me know either way? ;)

possible further improvements: As @spooks has said a db connection per thumbnail may be a bit of a problem... in that case just pull the config out of the db and into the php. (but the store admin would no longer be able to change thumbnail settings from the admin interface.)

Edited by mpalasis, 02 May 2012 - 02:53 PM.


#550   mpalasis

mpalasis
  • Members
  • 24 posts
  • Real Name:Makis Palasis

Posted 02 May 2012 - 03:14 PM

+ modification:
  • if thumbnails folder is specified, then a directory structure will be automatically created inside it to reflect the source image. (ie img=images/foo/bar/image.jpg .. thumbnails/images/foo/bar/image.jpg_thumb123x456.jpg...). This effect did not quite work, though the docs of the addon said it would...

Edited by mpalasis, 02 May 2012 - 03:16 PM.


#551   ce7

ce7
  • Members
  • 202 posts
  • Real Name:lyn

Posted 07 September 2012 - 05:24 AM

hi is there any image to show what this add on suppose to do?

Installed it, no error, but can't see if this add on did anything....

thanks

Lyn

#552   14steve14

14steve14

    STORE OWNER NOT CODER

  • Members
  • 3,081 posts
  • Real Name:Steve
  • Gender:Male
  • Location:Dorset UK

Posted 07 September 2012 - 09:42 AM

@ce7
What it should do is to reduce the size of the small thumbnail images on your site. The easiest way to see if it is working is to open your homepage and right click an image in the products new area. You should be able to see the file size there. Now open the same product in your browser and right click the main image and look at the filesize. The thumbnail image should be smaller than the large image size.

There is a better image contribution if you are using 2.3. Search the adsdons for kiss image or something similar.
REMEMBER BACKUP, BACKUP AND BACKUP
I am not a coder, so dont bother sending PMs asking for help as you wont get any.  

OSC has a steep learning curve, but in general the program does work.  If it doesnt work, the chances are it is something you have done.