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

#541   lildog

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

Posted 13 April 2012 - 22:12

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....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 - 22:57

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
  • 615 posts
  • Real Name:Todd
  • Gender:Male
  • Location:Sunny Florida

Posted 14 April 2012 - 00:44

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 - 00:55

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
  • 615 posts
  • Real Name:Todd
  • Gender:Male
  • Location:Sunny Florida

Posted 14 April 2012 - 12:33

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,394 posts
  • Real Name:Nick
  • Gender:Male
  • Location:World Citizen

Posted 14 April 2012 - 13:16

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 - 13:18.


#547   xvoyance

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

Posted 19 April 2012 - 03:33

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 - 16:38

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 - 14:50

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? /wink.png' class='bbc_emoticon' alt=';)' />

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 - 14:53.


#550   mpalasis

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

Posted 02 May 2012 - 15:14

+ 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 - 15:16.


#551   ce7

ce7
  • Members
  • 244 posts
  • Real Name:lyn

Posted 07 September 2012 - 05:24

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
  • Members
  • 3,518 posts
  • Real Name:Steve
  • Gender:Male
  • Location:Dorset UK

Posted 07 September 2012 - 09:42

@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

Don't take life too seriously. no one gets out alive anyway

#553   leveera

leveera
  • Members
  • 230 posts
  • Real Name:Sergei

Posted 12 August 2013 - 20:36

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

#554   dculley

dculley
  • Members
  • 294 posts
  • Real Name:Dean Culley
  • Gender:Male
  • Location:North Charleston, SC (USA)

Posted 07 August 2014 - 17:19

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.



#555   dculley

dculley
  • Members
  • 294 posts
  • Real Name:Dean Culley
  • Gender:Male
  • Location:North Charleston, SC (USA)

Posted 08 August 2014 - 15:47

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.