Jump to content



Photo
* * * * * 1 votes

'On The Fly' Auto Thumbnailer using GD Library 2.1


  • Please log in to reply
552 replies to this topic

#1   mloeffen

mloeffen
  • Members
  • 49 posts
  • Real Name:Martijn Loeffen

Posted 19 August 2005 - 09:26

Just started this thread to have a page that I can link to in the updated readme.

If you want to ask questions or have suggestions for 'On The Fly' Auto Thumbnailer using GD Library, then please do it here.

If you are looking for a previous support thread, you can look here. Another thread, which is actually located in the contribution anouncements, you can find here.

Cheers,
Martijn.

#2   Cancacti

Cancacti
  • Members
  • 5 posts
  • Real Name:nathalie
  • Location:The Netherlands

Posted 19 August 2005 - 12:37

Hoi,

Doesn't work with me, it fails to show images. My problem is that I have the site on the root, not in /catalog/. Ive made a catalog/images/thumbnails aswell but that didn't help either.

Do I have to make thumbs myself first?. Ive tried to chance the product_thumb but no luck either. I have GD Library 1.60 on my hoster.

Any advice?


Nathalie

#3   mloeffen

mloeffen
  • Members
  • 49 posts
  • Real Name:Martijn Loeffen

Posted 19 August 2005 - 16:15

Hoi,

Doesn't work with me, it fails to show images. My problem is that I have the site on the root, not in /catalog/. Ive made a catalog/images/thumbnails aswell but that didn't help either.

Do I have to make thumbs myself first?. Ive tried to chance the product_thumb but no luck either. I have GD Library 1.60 on my hoster.

Any advice?
Nathalie

<{POST_SNAPBACK}>

Thanks for your feedback.

As for your problem: it should work, but only since version 2.0 an aditional thumbnail-directory is supported. If you use version 2.1.2 the completely rewritten readme shows two sites where the contribution works for, and at least one store is located within root. This readme is also easier to follow when installing than the readme.txt that was included. Why not use that one?

Use the newer contribution-version and give me a link to your site (PM me if you want) and I'll help you out.

Edited by mloeffen, 19 August 2005 - 16:17.


#4   mloeffen

mloeffen
  • Members
  • 49 posts
  • Real Name:Martijn Loeffen

Posted 19 August 2005 - 16:53

As for your other question: no need to make the thumbnails yourself. After all it is called an auto-thumbnailer /wink.gif' class='bbc_emoticon' alt=';)' />

#5   diz

diz
  • Members
  • 1 posts
  • Real Name:Rafal

Posted 19 August 2005 - 18:26

I'm wondering if wouldn't it be better if URLs to images would be outputted as normal links. I mean, not as product_thumb?image.jpg&w=80&h=80 but already to resized image like images/image.jpg.thumb_80x80.jpg.

Thumbnails in this case would need to be generated a little bit sooner (when page is requested instead of when image itself is requested) but it has one advantage that I can think of - we would not need to mess with headers, browser and server would take care of it.

#6   Geordiedan

Geordiedan
  • Members
  • 149 posts
  • Real Name:Dan

Posted 19 August 2005 - 19:20

Hi,

I've just installed your thumbnailer and it works great for JPEG images - however it refuses to parse my GIFs at all /sad.gif' class='bbc_emoticon' alt=':(' />

The URL for the thumbed images returns a blank box, but it does refer to a valid image.

I've tried setting JPEG as GIFs to on, but this generates an error.

Do you have any ideas?

Dan

#7   Geordiedan

Geordiedan
  • Members
  • 149 posts
  • Real Name:Dan

Posted 19 August 2005 - 19:24

Hi,

I've just installed your thumbnailer and it works great for JPEG images - however it refuses to parse my GIFs at all /sad.gif' class='bbc_emoticon' alt=':(' />

The URL for the thumbed images returns a blank box, but it does refer to a valid image.

I've tried setting JPEG as GIFs to on, but this generates an error.

Do you have any ideas?

Dan

<{POST_SNAPBACK}>


I am such an idiot - folks, make sure you have a thumbnails folder in any subdirectories in your images folder!! /blush.gif' class='bbc_emoticon' alt=':blush:' /> /blush.gif' class='bbc_emoticon' alt=':blush:' /> /blush.gif' class='bbc_emoticon' alt=':blush:' />

#8   kevinc66

kevinc66
  • Members
  • 81 posts
  • Real Name:Kevin Chan

Posted 21 August 2005 - 08:26

The thumbnails are the same size as in product_info. Even click enlarge is still the same size. What happen to the original picture.

Thanks and sorry for being stupid.
Kevin

#9   mloeffen

mloeffen
  • Members
  • 49 posts
  • Real Name:Martijn Loeffen

Posted 21 August 2005 - 08:47

Have you read the installation-section in the readme.html?

I noticed a few things: when using http://www.simplyvcd....jpg&w=90&h=100 it gives the error that the thumbnail could not be displayed cause it contains errors. If you are using a gd-library version < 2.0.1 you should set $use_resampling to false (it's default set to true) in product_thumb.php.
In the same file, set $use_truecolor to false (default set to true) for the same reason as above.

Did you also edit /catalog/includes/functions/html_output.php according to the readme?

#10   mloeffen

mloeffen
  • Members
  • 49 posts
  • Real Name:Martijn Loeffen

Posted 21 August 2005 - 08:58

Looking good Kev /thumbsup.gif' class='bbc_emoticon' alt=':thumbsup:' />

#11   amd64lover

amd64lover
  • Members
  • 2 posts
  • Real Name:Ronald

Posted 21 August 2005 - 15:19

I have installed this following the instructions in the Read Me file exactly... It still doesnt work for me... In Step 3 it says ..."Note: check this configuration file to make sure the path is set correctly for both your catalog directory *and* your images directory. With this installation-example, the DIR_WS_HTTP_CATALOG value should be '/catalog/' and the DIR_WS_IMAGES value, 'images/'. Notice that it doesn't have a leading '/')!"...
When I take out the leading '/', no pictures are displayed on our homepage (www.dasaexoticart.com/osCommerce). When I leave it in there, pictures are displayed, but they are not in the correct proportions.
It looks like they are in the proportions set in the Configuration -> My Store -> Images... I am not sure what I am doing wrong, but it doesnt look like any thumbnails are being created... Please Help!

Edited by amd64lover, 21 August 2005 - 15:20.


#12   mloeffen

mloeffen
  • Members
  • 49 posts
  • Real Name:Martijn Loeffen

Posted 24 August 2005 - 11:48

4 amd64lover his configure.php was fixed and the product_thumb.php was re-uploaded. All works well now.

#13   amd64lover

amd64lover
  • Members
  • 2 posts
  • Real Name:Ronald

Posted 24 August 2005 - 13:43

thanks so much

#14   Rayzak

Rayzak
  • Members
  • 90 posts
  • Real Name:na
  • Gender:Male
  • Location:na

Posted 26 August 2005 - 02:57

It is very cool, thank you!

One question: how about adding the possibility to create a watermark with whatever image I want? It would be a great feature

#15   aeps

aeps
  • Members
  • 1 posts
  • Real Name:Andreas Ernst

Posted 29 August 2005 - 09:59

oscommerce-2.2ms2

If you have issues with the admin section and in

/catalog/admin/includes/configure.php

you have this line here:
define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');

change it to:

define('DIR_WS_CATALOG_IMAGES', '../images/');

then it works with the admin section too.

A must have contrib /cool.gif' class='bbc_emoticon' alt='B)' />

#16   receptiveit

receptiveit
  • Members
  • 1 posts
  • Real Name:Alex Ferrara

Posted 29 August 2005 - 23:38

I have just installed auto-thumbnailer and it seems to work terrifically. One thing that I noticed is, in the admin section, whilst editing existing products, osCommerce is complaining about the image not being uploaded, even though it is and a thumbnail is being generated. This sounds like osCommerce is checking for a file which doesn't exist.

I am using php5

aF

#17   haezer

haezer
  • Members
  • 7 posts
  • Real Name:Whitez

Posted 30 August 2005 - 23:59

Hi,

Just installed this and it works only if I change $tn_server_cache = false;
If I swicth caching then it wont work (broken thumbnail). My shop is in root without catalog.
I have followed the instruction.
Can someone show me what other settings I need to change?
Thank you.

#18   boxtel

boxtel
  • Members
  • 5,237 posts
  • Real Name:amanda
  • Location:Taipei, Taiwan

Posted 31 August 2005 - 04:35

Hi,

Just installed this and it works only if I change $tn_server_cache = false;
If I swicth caching then it wont work (broken thumbnail). My shop is in root without catalog.
I have followed the instruction.
Can someone show me what other settings I need to change?
Thank you.

<{POST_SNAPBACK}>

I was struggling with that too. it seems that the thumbnail directory has to be put under the root. So if your images are in "www.site.com/images" and your thumbnail directory is set to "thumb/" then you need to create a subdirectory in the root called "thumb/images".


one strange thing I cannot get is that in IE when looking at the properties of the thumbnail I always get :

http://www.site.com/product_thumb.php?

no parameters are shown there and I believe no browser caching is done whereas in FF it does show the parameters but then with :

http://www.site.com/.....es/theimage.....

in other words without the thumbnail directory in the reference.
Treasurer MFC

#19   boxtel

boxtel
  • Members
  • 5,237 posts
  • Real Name:amanda
  • Location:Taipei, Taiwan

Posted 31 August 2005 - 05:52

I was struggling with that too. it seems that the thumbnail directory has to be put under the root. So if your images are in "www.site.com/images" and your thumbnail directory is set to "thumb/" then you need to create a subdirectory in the root called "thumb/images".
one strange thing I cannot get is that in IE when looking at the properties of the thumbnail I always get :

http://www.site.com/product_thumb.php?

no parameters are shown there and I believe no browser caching is done whereas in FF it does show the parameters but then with :

http://www.site.com/......es/theimage.....

in other words without the thumbnail directory in the reference.

<{POST_SNAPBACK}>


it seems that if I use this :

$lastModifiedHttpFormat = gmdate('D, d M Y H:i:s',$lastModified ) . ' GMT';


IE seems to cache ok and gives 304 headers, in the original, I could not get rid of the 200 responses.
Treasurer MFC

#20   boxtel

boxtel
  • Members
  • 5,237 posts
  • Real Name:amanda
  • Location:Taipei, Taiwan

Posted 31 August 2005 - 06:06

it seems that if I use this :

$lastModifiedHttpFormat = gmdate('D, d M Y H:i:s',$lastModified ) . ' GMT';
IE seems to cache ok and gives 304 headers, in the original, I could not get rid of the 200 responses.

<{POST_SNAPBACK}>


the original outputs (in my case) local taipei time and I suspect that IE does not accept any other time but the Gates Microsoft Time.
Treasurer MFC