Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

'On The Fly' Auto Thumbnailer using GD Library 2.1


mloeffen

Recommended Posts

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

Link to comment
Share on other sites

  • 11 months later...
  • Replies 556
  • Created
  • Last Reply

Top Posters In This Topic

Just report how it works on my fresh OSC 2.3.3

 

1. Image uploaded on admin/categories.php in "Products Image: Main Image" window makes no thumbnali for product_info. page, full size image dispayed instead. Also it doesn't put image in database table so checkbox "Delete this Image from the Server (Permanent!)?" useless. If at this stage to tick "Delete this Image from the Server (Permanent!)?" and press Save it results error

Warning: unlink(/.../catalog/images/) [function.unlink]: Permission denied in ...\www\catalog\admin\categories.php on line 212

Warning: Cannot modify header information - headers already sent by (output started at ...\www\cataolg\admin\categories.php:212) in

...\www\catalog\admin\includes\functions\general.php on line 38

 

2. To make a tumbnail on product_info. page - upload image by "+Add large image". Not quite sure but seems images uploaded by "+Add large image" not affected by this contribution

Also "+Add lage image" option uploads image to database. To delete from database use recycle bin sign in "+Add lage image" window. Again using checkbox "Delete this Image from the Server (Permanent!)?" gives only error same as above.

 

Tip. If you having thumbnail image created in the same directory as main image, not in Thumbnail folder - it means what you didnt set path to thumbnails in Admin-Configuration-Thumbnails

Link to comment
Share on other sites

  • 11 months later...

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

 

I tried the above, it fixed 90% of the issues with admin images. Thank you.  How ever it knock out the image in the item edit file.  I'm not a code writer, some how the code you repaced iffected that one.  Maybe you can figure that one out  and add it back some how.  I would greatly appreciate it.

Link to comment
Share on other sites

I have upgraded to OSC 2.3.4 and PHP5.4.  I'm having problems on the catalog side and the admin side.  I have lost the catalog images on both sides.  Is there a new update for On The Fly Tumbnailer?  It looks like the product_thumb.php and html_output.php, on both sides are broken.

Link to comment
Share on other sites

  • 3 years later...
On 8/8/2014 at 5:47 PM, dculley said:

I have upgraded to OSC 2.3.4 and PHP5.4.  I'm having problems on the catalog side and the admin side.  I have lost the catalog images on both sides.  Is there a new update for On The Fly Tumbnailer?  It looks like the product_thumb.php and html_output.php, on both sides are broken.

Same Problem here

Link to comment
Share on other sites

The only thumbnailer ubdated for newest versions is KissIt Image Thumbnailer:

KissIT Image Thumbnailer BS

Use r27 for non Bootstrab/responsive store (2.3.4 standard)

installation is 5 min

Edited by raiwa
Link to comment
Share on other sites

On ‎8‎/‎8‎/‎2014 at 11:47 AM, dculley said:

It looks like the product_thumb.php

I haven't looked it in a while but I seem to recall that that file uses ereg calls, which will break on 5.4. You should replace the addon with the one mentioned by raiwa.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...