Jump to content
mloeffen

'On The Fly' Auto Thumbnailer using GD Library 2.1

Recommended Posts

hey guys

 

Just a quick question

 

I've been using your great contribution fine untill we moved servers, now it dosn't work!!! All I can get it to do is display picts that are all distorted? Please could you help

Share this post


Link to post
Share on other sites
hey guys

 

Just a quick question

 

I've been using your great contribution fine untill we moved servers, now it dosn't work!!! All I can get it to do is display picts that are all distorted? Please could you help

 

I presume you've tried changing the resample and truecolour options?

 

Becki

Share this post


Link to post
Share on other sites
I presume you've tried changing the resample and truecolour options?

 

Becki

 

How do you change the options? My colours are all distorted, I've tried amending the original image and that doesnt help in all cases.

Share this post


Link to post
Share on other sites

Hi,

 

I've read through this post, I apologize if I missed the answer to this question... after the 5th page I started to skim.

 

I installed the thumbnailer, and it doesn't work. One problem I noticed off the bat is a reference to the function 'imagecreate' in

product_thumb.php. I did a recursive grep and didn't find this function anywhere. Where is it located?

 

Thanks!

Share this post


Link to post
Share on other sites
How do you change the options? My colours are all distorted, I've tried amending the original image and that doesnt help in all cases.

 

you can change the settings at the top of product_thumb.php

 

something at the top like (depending on your version)

 

<?php
// "On the Fly Thumbnailer" using PHP GD Graphics Library by Nathan Welch (v1.5)
// Scales product images dynamically, resulting in smaller file sizes, and keeps
// proper image ratio.  Used in conjunction with modified tep_image in html_output.php
//
// CONFIGURATION SETTINGS
//
// Use Resampling? Set the value below to true to generate resampled thumbnails
// resulting in smoother-looking images.  Not supported in GD ver. < 2.01
$use_resampling = true;
//
// Create True Color Thumbnails? Better quality overall but set to false if you
// have GD version < 2.01 or if creating transparent thumbnails.
$use_truecolor = true;
//
// Output GIFs as JPEGS? Set this option to true if you have GD version > 1.6
// and want to output GIF thumbnails as JPGs instead of GIFs or PNGs.  Note that your
// GIF transparencies will not be retained in the thumbnail if you output them
// as JPGs. If you have GD Library < 1.6 with GIF create support, GIFs will
// be output as GIFs. Set the "matte" color below if setting this option to true.
$gif_as_jpeg = false;
//
// Define RGB Color Value for background matte color if outputting GIFs as JPEGs
// Example: white is r=255, b=255, g=255; black is r=0, b=0, g=0; red is r=255, b=0, g=0;
$r = 255; // Red color value (0-255)
$g = 255; // Green color value (0-255)
$b = 255; // Blue color value (0-255)

 

you could try the resampling and truecolour set to either true or false or a combination. When i had my distored images (note though it was more the colour that was distorted not the whole image so to speak that was causing it to look distorted - if that makes sense!) it worked for me with both set to true.

 

becki

Share this post


Link to post
Share on other sites
you can change the settings at the top of product_thumb.php

 

something at the top like (depending on your version)

 

<?php
// "On the Fly Thumbnailer" using PHP GD Graphics Library by Nathan Welch (v1.5)
// Scales product images dynamically, resulting in smaller file sizes, and keeps
// proper image ratio.  Used in conjunction with modified tep_image in html_output.php
//
// CONFIGURATION SETTINGS
//
// Use Resampling? Set the value below to true to generate resampled thumbnails
// resulting in smoother-looking images.  Not supported in GD ver. < 2.01
$use_resampling = true;
//
// Create True Color Thumbnails? Better quality overall but set to false if you
// have GD version < 2.01 or if creating transparent thumbnails.
$use_truecolor = true;
//
// Output GIFs as JPEGS? Set this option to true if you have GD version > 1.6
// and want to output GIF thumbnails as JPGs instead of GIFs or PNGs.  Note that your
// GIF transparencies will not be retained in the thumbnail if you output them
// as JPGs. If you have GD Library < 1.6 with GIF create support, GIFs will
// be output as GIFs. Set the "matte" color below if setting this option to true.
$gif_as_jpeg = false;
//
// Define RGB Color Value for background matte color if outputting GIFs as JPEGs
// Example: white is r=255, b=255, g=255; black is r=0, b=0, g=0; red is r=255, b=0, g=0;
$r = 255; // Red color value (0-255)
$g = 255; // Green color value (0-255)
$b = 255; // Blue color value (0-255)

 

you could try the resampling and truecolour set to either true or false or a combination. When i had my distored images (note though it was more the colour that was distorted not the whole image so to speak that was causing it to look distorted - if that makes sense!) it worked for me with both set to true.

 

becki

 

Thanks so much - that's sorted it out :lol:

Share this post


Link to post
Share on other sites

Hi,

I've tried to read through this thread to find the answer to what ails me, but alas, can't find it...

 

I've installed and used the Auto Thumbnailer with much success in the past but for whatever reason, this time around I'm getting grief. Honestly, I don't know if my troubles are due to the Thumbnailer, but I sure hope someone can help...

 

To preface - all product images and thumbnails work wonderfully...

 

It's the catalog thumbnails that aren't showing up. Please see this page: http://wendydewarhughes.com/catalog/index.php?cPath=21

 

When I go to add in an image for a particular category, I'm getting this error message:

Error Error: File upload not saved.

And of course, a broken image on the page I posted above.

 

To add to my troubles, if I look at my view sources, not all of the image paths are that similar to:

product_thumb.php?img=images/bra pads-header-e-store.gif&w=70&h=57

 

some, like the "serenity" category, show as:

images/serenity-header-e-store.gif

 

Now to clarify - that serenity pic is showing up because I manually uploaded it into the images folder...

 

Can anyone shed some light on the subject for me please??

 

Thanks

Share this post


Link to post
Share on other sites
Hi,

I've tried to read through this thread to find the answer to what ails me, but alas, can't find it...

 

I've installed and used the Auto Thumbnailer with much success in the past but for whatever reason, this time around I'm getting grief. Honestly, I don't know if my troubles are due to the Thumbnailer, but I sure hope someone can help...

 

<snip>

 

 

Never mind... fixed it after hours of pulling out my hair. Turns out it was an images folder permissions problem. We're on a Windows server (which I completely forgot to compensate for) and was incorrectly setting the permissions. Once I finally figured it out, voila, the thumbnails are now showing up as should....

Share this post


Link to post
Share on other sites

I just want to say "Thanks" for this nice contribution. The instructions built with dynamic HTML were especially easy to follow, and the contribution was quickly working as advertised. The extra options for server and browser catching and compatibility for older GD versions were also appreciated features.

 

Thanks everyone!

Share this post


Link to post
Share on other sites

Hi all,

 

I have a version of this working just fine except that if the original image is smaller than the requested thumbnail it doesn't resize which I understand is for a security measure. I have old images from an exsiting website that are small but all my new ones i'm doing larger. Hence for this to work correctly is there a way for the code instead of not resizing at all (and letting the image distort etc) that when it finds the original is smaller it just outputs a thumbnail the same size as the original. I will try and code it myself but am very inexperienced so if anyone knows please let me know?!

 

Thanks

 

becki

 

The other option is to make it resize everything (which i have been able to mod the code to do) but then there's the security issue and also making small fies bigger doesn't give a very nice look!

 

Thank you

Share this post


Link to post
Share on other sites

Seems I had an older version without the 'center original image' mod already in so I updated mine.

 

Becki

Share this post


Link to post
Share on other sites

@Mark: thank you for your positive feedback. These are also appreciated :thumbsup:

@Becki: glad to hear you got it sorted.

 

Cheers :)

Share this post


Link to post
Share on other sites

Hi Martijn,

 

Is there any chance of you uploading a new version, one coming from you with all the bug fixes sorted, all the extras added on and setting it a new version with full install instructions...

 

I've tried going through the contribs part, but seems loads of people have gone and done loads of stuff, and I can't seem to get the one that is the newest and best one to download and install...

 

Thank you in advance!


Riaan

Share this post


Link to post
Share on other sites
Hi Martijn,

 

Is there any chance of you uploading a new version, one coming from you with all the bug fixes sorted, all the extras added on and setting it a new version with full install instructions...

 

I've tried going through the contribs part, but seems loads of people have gone and done loads of stuff, and I can't seem to get the one that is the newest and best one to download and install...

 

Thank you in advance!

I'm actually doing an update now. It will be version 2.2 and will include:

 

- Added an admin page to control the configuration settings from catalog/product_thumb.php

- Included file gdtest.php which makes it easy to see if the GD Library is installed on your server

- Added 'Control compression of thumbnailed (JPEG) images' update by idolcemia (29.10.06)

- Put a setting in admin/thumbnails to control level of JPEG compression

- Added 'Default image' update by dannet (09.04.06)

- Added no_image.jpg for use as default image

- Fixed this readme document's HTML/CSS code. It now validates and works properly in all browsers

- Rewrote some of this readme document

 

The main benefits of this version are the admin control and the inclusion of the updates. The last full package was khairil's 'auto create thumbnail dir and win32 pathSep' which I've used as the basis for this update. I couldn't get buitek's 'BMP and & fix' to work and didn't see how Bill.Dagou's 'Backend patch' was relevant to this version.

 

I hope Martijn doesn't mind me making this update. I haven't changed any of the real guts of this contribution as they seem to work perfectly as they are. Apart from wanting to add admin control I thought it would be handy to have a full package update to make it easy for everyone.

 

I'm an old image magic user but since that was removed from the contribs section I decided to reassess my needs. This contribution is much lighter and easier to install than image magic was. I'm very happy to have found such a great contrib (thanks to pixclinic!).

Share this post


Link to post
Share on other sites

I finally added the update. I hope people find it of use.

 

If anyone can see a problem with it please let me know by PM.

Share this post


Link to post
Share on other sites
I finally added the update. I hope people find it of use.

 

If anyone can see a problem with it please let me know by PM.

Nice one Richard. It was about time for a full package release and I think your update will be appreciated by quite a few people.

 

Keep up the good work :thumbsup:

 

Martijn.

Share this post


Link to post
Share on other sites

Thanks Bill. I can't take all the credit as you can see if you download the last full package. I just added some stuff to make it easier for people.

Share this post


Link to post
Share on other sites

Hello Everyone,

 

I'm new to oscommerce and otf_autothumbnailer. O Yea! and html/PHP in general....... >_<

I have a little HTML knowledge. I just have a quick question about step #6 in the insatll instructions (Step #6 - Run the SQL statements....Find the file auto_thumbnailer_admin.sql and run it on your database.). How do I go about doing this? I installed a copy (OTF_AutoThumb_MB_2.2) yesterday and it all went well, Images resized, no error... except the pictures are showing as Red X's. I skipped this step #6, I'm assuming this may be my problem..not sure tho. <_< I want to do a clean install as soon as I get a little help.

 

.....any help would be great.

 

.....and THANK all of you who put the time and effort into these add_ons...they are life savers for all the HTML/PHP impaired....LOL like me!

 

 

Thanks again,

 

Kevin

Share this post


Link to post
Share on other sites
Hello Everyone,

 

I'm new to oscommerce and otf_autothumbnailer. O Yea! and html/PHP in general....... >_<

I have a little HTML knowledge. I just have a quick question about step #6 in the insatll instructions (Step #6 - Run the SQL statements....Find the file auto_thumbnailer_admin.sql and run it on your database.). How do I go about doing this? I installed a copy (OTF_AutoThumb_MB_2.2) yesterday and it all went well, Images resized, no error... except the pictures are showing as Red X's. I skipped this step #6, I'm assuming this may be my problem..not sure tho. <_< I want to do a clean install as soon as I get a little help.

 

.....any help would be great.

Are you familiar with PHPMyAdmin or any other MySQL administration software?

 

If you can use PHPMyAdmin just login and select the database for your store. Click on 'Import', select the file to import and click 'Go'. This will run the SQL statements in the .sql file on the database. The contribution will not work properly without this step.

Share this post


Link to post
Share on other sites
Are you familiar with PHPMyAdmin or any other MySQL administration software?

 

If you can use PHPMyAdmin just login and select the database for your store. Click on 'Import', select the file to import and click 'Go'. This will run the SQL statements in the .sql file on the database. The contribution will not work properly without this step.

I almost forgot:

 

Make sure to use the new .sql file in the Minor Update I added.

Share this post


Link to post
Share on other sites

Hello Rich,

 

 

Thank you for your speeeeeedy response. I did a clean install of oscommerce and Thumbnailer. I did what you said in mysqladmin, it said all went well when I imported and click go. I still get the red X's im my thumb images, but if I click the large image it shows up good, just not the thumbs. I looked in my catalog/images/ folder and the thumbnails are there. Is there a path I need to change or somthin?

 

Thanks again,

 

Kevin

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×