Jump to content
mloeffen

'On The Fly' Auto Thumbnailer using GD Library 2.1

Recommended Posts

Sorry I can't edit my post for some reason, but I fixed it chemjul2005!!!

 

Configuration > Images

 

Your Heading Image Width and Height need to be set to 1 and 1. Mine were set to 57 and 40.

Share this post


Link to post
Share on other sites
Sorry I can't edit my post for some reason, but I fixed it chemjul2005!!!

 

Configuration > Images

 

Your Heading Image Width and Height need to be set to 1 and 1. Mine were set to 57 and 40.

 

thanks, that works for the transparent gifs, but i have some heading images i would like to show..... ah well, i will either change everything to transparent or make a big transparent gif for the ones I don't want to show. Thanks again!

 

gina

Share this post


Link to post
Share on other sites

Hi me again.

When I install the admin thumbnail option I've the problem that the language flags in the admin panel aren't showed. Normaly when you create a product you have these language flag left of the description field (for every installed language). I have there only a red cross (broken image link) and the text of the language (for example english).

 

Is the problem knowen? Is there a solution to solve it?

 

I did everything to install the contrib as mentioned in the instructions.

 

I'm sure the problem is within catalog/admin/includes/functions/html_output.php. There you have to replace the function tep_image with the same one that has to be replaced in catalog/includes/functions/html_output.php. But the original function in catalog/admin/includes/functions/html_output.php is much smaller than the one in catalog/admin/includes/functions/html_output.php. When I disable these function (and so disable the admin thumbnailing option) everything is fine.

Share this post


Link to post
Share on other sites

hi, i have the same here.

 

Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/includes/languages/dutch/images/icon.gif) is not within the allowed path(s): (/www/htdocs/hancy:/tmp) in /www/htdocs/hancy/admin/includes/functions/html_output.php on line 72

 

is this a known issue?

 

anybody a solution?

 

thanks in advance.

Share this post


Link to post
Share on other sites

Ok I figured out that when I disable the no_image abillity the flags are showing. But than I have (of course) a red cross (for broken links) for images from products without a image.

Also I figured out that I have these red crosses not only for the language flags but also for images from products without images when I use the original OTF AutoThumb code.

The responsible code is

	// if no file exists display the 'no image' file
if (!is_file($src)) {
$src = "images/no_image.jpg";
}

 

So when I outline it I see the flags and the red crosses for the images from products without images.

 

When I change it into:

	// if no file exists display the 'no image' file
if (!is_file($src)) {
$src = DIR_WS_CATALOG_IMAGES . "no_image.jpg";
}

I have the no_image image for products without images AND also for the flags!

 

I'm using OTF AutoThumb Version 2.3a and tried with and without modifying catalog/admin/includes/configure.php (Step #12). But without success.

 

I checked the content from $src and it's ok:

/catalog/includes/languages/english/images/icon.gif
. But why can't it be showen? Has OTF problems displaying Gif files?

 

So has someone a working installation where he / she can see the no_image.jpg (if needed) and can see the flags and (of course) has enabled thumbnailing the admin section (backend)? If please post your solution.

Share this post


Link to post
Share on other sites

Hey guys,

I'm just wondering if anyone can help me with this problem.

 

I've just installed this contrib on a BETA server and it works amazingly well, fantastic results however, there is just one problem that i have with product_info.php

which i have tried many different ways to try and fix it.

 

Basically, when you click the image and the product opens up on the page - (product_info.php?products_id=1760) for example, the thumbnail has shrunk but attempted to stay to some sort of ratio - i've tried changing:

SMALL_IMAGE_HEIGHT

 

To

SMALL_IMAGE_HEIGHT*2, SMALL_IMAGE_WIDTH*2

 

Along with other sizes, but nothing seems to work - when i did *2 some images looked ok, others became too big!

 

Anyone know of a fix? the website is:

http://firsttradelimited.com/beta/index.php

 

Example product:

http://firsttradelimited.com/beta/product_...roducts_id=1840

Share this post


Link to post
Share on other sites

I don't understand the installation process for this contribution. Replacing tep_image with tep_image_thumb causes errors all around the site because tep_image is still being called.

Share this post


Link to post
Share on other sites

hey

 

When i try and add images for my subcategories I get errors and the image keeps its original width but reduces its height to literally 1 pixel.

 

Could someone help me with uploading images for subcategories. I started a thread here before I found this one, it has some more information that you may find useful like snippets of code and such.

 

Thanks,

 

Ben

 

EDIT: you wont be able to see the image I tried to upload on my site as I quoted in the other thread as I removed it because I didnt want visitors to see the errors.

Edited by Benjjj6

Share this post


Link to post
Share on other sites

Is there an issue with the html wrapper in the html_output.php?

 

I've noticed that my images, which are set in the admin at Small Image Width 100, and Small Image Height 100, are now being resized by some obscure method.

 

The images are not showing , and the empty boxes are saying the thumbnails are all different sizes

product_thumb.php?img=images/productName1.jpg&w=100&h=77

product_thumb.php?img=images/productName2.jpg&w=100&h=100

product_thumb.php?img=images/productName3.jpg&w=100&h=66

 

This is incredibly ugly.

 

So I looked at the html_output.php file.

 

Under the code:

	// Don't calculate if the image is set to a "%" width
if (strstr($width,'%') == false || strstr($height,'%') == false) {
	$dont_calculate = 0;
} else {
	$dont_calculate = 1;
}

// Dont calculate if a pixel image is being passed (hope you dont have pixels for sale)
if (!strstr($image, 'pixel')) {
	$dont_calculate = 0;
} else {
	$dont_calculate = 1;
}

// Do we calculate the image size?
if (CONFIG_CALCULATE_IMAGE_SIZE && !$dont_calculate) {

 

I'm wondering where that CONFIG_CALCULATE_IMAGE_SIZE came from?

I've done a global search for that text string, and the ONLY places it shows up is in the readme.html file for the OTF Auto Thumbnailer and in my modified html_output.php file.

 

That string also happens to show up if one still has the oscommerce INSTALL FILES on their site.

I'm thinking this might be a problem, and probably why the contribution isn't working properly for me. My INSTALL files were deleted from my website for security reasons.

 

Will see if I can find a solution, but am beat for the night.

Share this post


Link to post
Share on other sites

Oh, never mind, that CONFIG_CALCULATE_IMAGE_SIZE is in the original html_output file, too.

 

***still baffled why this isn't working properly.****

Share this post


Link to post
Share on other sites
I don't understand the installation process for this contribution. Replacing tep_image with tep_image_thumb causes errors all around the site because tep_image is still being called.

 

I think you're referring to Step 7 of the install instructions. I assume when it says:

 

Find the code below (73):

 

// The HTML image wrapper function

 

 

Replace everything between that code and the following code (116):

 

// The HTML form submit button wrapper function

 

it means replace the code between those two points with the code in Step 7 of the install instructions.

 

 

hope that helps, perhaps someone else can confirm that that is what you are meant to do?

 

 

Ben

Share this post


Link to post
Share on other sites

Hi

Just installed the contrib and even a "duh" like me got it to work fine. Great contrib :thumbsup:

 

I saw it was possible to change how the main product image was resized but that I will work on tonight :)

 

Is there a way to have it to make thumbs with equal length of the sides?

Ive tried to search but Im pretty sure Im using the wrong search words

 

Kind regards

 

/Anders

Share this post


Link to post
Share on other sites
hi, i have the same here.

 

Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(/includes/languages/dutch/images/icon.gif) is not within the allowed path(s): (/www/htdocs/hancy:/tmp) in /www/htdocs/hancy/admin/includes/functions/html_output.php on line 72

 

is this a known issue?

 

anybody a solution?

 

thanks in advance.

 

check these lines in \admin\includes\configure.php at about

 

line 23 --> define('DIR_WS_IMAGES', 'images/');

 

line 25 --> define('DIR_WS_CATALOG_IMAGES', '../images/');

 

if the last line is like

 

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

 

it partly causes the open_basedir restriction error.

 

i now and then have the error in certain circumstances.

 

good luck.

Share this post


Link to post
Share on other sites

I've been having some trouble with this contribution resizing images that have an & in their filename.

 

The images show up fine if they've not been resized, but anything that's not the original dimensions doesn't get resized.

 

Is this something to do with the GD Library?

 

Thanks for any info.

Share this post


Link to post
Share on other sites

I have followed the instructions 3 times and I still can not see thumbnails. I am actually getting a 404 back from apache. If I add phpInfo(); as the first line in my product_thumbs.php file, I see the phpInfo so I know the file is getting read. Any suggestions? You can see my catalog at http://future.artisit.com/catalog.

 

Thanks in advance.

Share this post


Link to post
Share on other sites

Hi there,

 

I figured out a place where OTF-AutoThumb is not enabled: In product_reviews_write.php.

 

So replace the line (around line 200):

 document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');

 

with (for bonus tip no. 1):

 document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH*2, SMALL_IMAGE_HEIGHT*2, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');

You can use another multiplier.

 

or (for bonus tip no.2):

 document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');

Replace SMALL_IMAGE_WIDTH and SMALL_IMAGE_HEIGHT eighter with PRODUCT_IMAGE_WIDTH and PRODUCT_IMAGE_HEIGHT (if you want the same size like in product_info.php) or with CART_IMAGE_WIDTH and CART_IMAGE_HEIGHT (if you want the same size like in shopping_cart.php) or the third possibility:

If you want a different size for the images showen in the write rewies page do the following:

Replace it with REVIEWS_IMAGE_WIDTH and REVIEWS_IMAGE_HEIGHT and insert the following sql commands:

INSERT INTO configuration SET
configuration_title='Reviews Image Width',
date_added=NOW(),
sort_order='',
configuration_group_id='4',
configuration_key='REVIEWS_IMAGE_WIDTH',
configuration_value='150',
configuration_description='The pixel width of the product images on product_reviews_write.php',
use_function=NULL,
set_function=NULL;

INSERT INTO configuration SET
configuration_title='Reviews Image Height',
date_added=NOW(),
sort_order='',
configuration_group_id='4',
configuration_key='REVIEWS_IMAGE_HEIGHT',
configuration_value='150',
configuration_description='The pixel height of the product images on product_reviews_write.php',
use_function=NULL,
set_function=NULL;

 

 

The same for:

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

 

Now you can set the size for product images in product_reviews_write.php within the backend (admin section) under Configuration > Images > Reviews Image Height & Reviews Image Width.

 

I hope someone can insert it in the next build and hopefully it helps you. Erik aka Grinse

Edited by Grinse

Share this post


Link to post
Share on other sites

Also OTF-AutoThumb is not enabled in product_reviews_info.php.

 

So replace the line:

document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $review['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $review['products_image'], addslashes($review['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');

 

with (for bonus tip no. 1):

document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $review['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $review['products_image'], addslashes($review['products_name']), SMALL_IMAGE_WIDTH*2, SMALL_IMAGE_HEIGHT*2, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');

 

You can use another multiplier.

 

or (for bonus tip no.2):

document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $review['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $review['products_image'], addslashes($review['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');

Replace SMALL_IMAGE_WIDTH and SMALL_IMAGE_HEIGHT eighter with PRODUCT_IMAGE_WIDTH and PRODUCT_IMAGE_HEIGHT (if you want the same size like in product_info.php) or with CART_IMAGE_WIDTH and CART_IMAGE_HEIGHT (if you want the same size like in shopping_cart.php) or the third possibility:

If you want a different size for the images showen in the write rewies page do the following:

Replace it with REVIEWS_IMAGE_WIDTH and REVIEWS_IMAGE_HEIGHT and insert the following sql commands:

 

INSERT INTO configuration SET
configuration_title='Reviews Image Width',
date_added=NOW(),
sort_order='',
configuration_group_id='4',
configuration_key='REVIEWS_IMAGE_WIDTH',
configuration_value='150',
configuration_description='The pixel width of the product images on product_reviews_write.php',
use_function=NULL,
set_function=NULL;

INSERT INTO configuration SET
configuration_title='Reviews Image Height',
date_added=NOW(),
sort_order='',
configuration_group_id='4',
configuration_key='REVIEWS_IMAGE_HEIGHT',
configuration_value='150',
configuration_description='The pixel height of the product images on product_reviews_write.php',
use_function=NULL,
set_function=NULL;

 

 

The same for:

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $review['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $review['products_image'], $review['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

 

 

Now you can set the size for product images in product_reviews_info.php within the backend (admin section) under Configuration > Images > Reviews Image Height & Reviews Image Width.

 

I hope someone can insert it in the next build and hopefully it helps you. Erik aka Grinse

Share this post


Link to post
Share on other sites

Ok, the third place where you can enable OTF-AutoThumb is product_reviews.php.

 

Replace the line:

document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');

 

with (for bonus tip no. 1):

document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH*2, SMALL_IMAGE_HEIGHT*2, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');

You can use another multiplier.

 

or (for bonus tip no.2):

document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');

 

Replace SMALL_IMAGE_WIDTH and SMALL_IMAGE_HEIGHT eighter with PRODUCT_IMAGE_WIDTH and PRODUCT_IMAGE_HEIGHT (if you want the same size like in product_info.php) or with CART_IMAGE_WIDTH and CART_IMAGE_HEIGHT (if you want the same size like in shopping_cart.php) or the third possibility:

If you want a different size for the images showen in the write rewies page do the following:

Replace it with REVIEWS_IMAGE_WIDTH and REVIEWS_IMAGE_HEIGHT and insert the following sql commands:

 

INSERT INTO configuration SET
configuration_title='Reviews Image Width',
date_added=NOW(),
sort_order='',
configuration_group_id='4',
configuration_key='REVIEWS_IMAGE_WIDTH',
configuration_value='150',
configuration_description='The pixel width of the product images on product_reviews_write.php',
use_function=NULL,
set_function=NULL;

INSERT INTO configuration SET
configuration_title='Reviews Image Height',
date_added=NOW(),
sort_order='',
configuration_group_id='4',
configuration_key='REVIEWS_IMAGE_HEIGHT',
configuration_value='150',
configuration_description='The pixel height of the product images on product_reviews_write.php',
use_function=NULL,
set_function=NULL;

 

 

The same for:

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

 

 

Now you can set the size for product images in product_reviews_write.php within the backend (admin section) under Configuration > Images > Reviews Image Height & Reviews Image Width.

 

I hope someone can insert it in the next build and hopefully it helps you. Erik aka Grinse

Share this post


Link to post
Share on other sites

More details for my problem:

 

Thumbnailing is working correctly on the main site. (Images that were uploaded before installing the contrib now have thumbnails). I checked the The images directory is set to chmod 777.

 

My catalog isn't in a subfolder, so I have my configure file set as follows:

 

define('DIR_WS_HTTP_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');
define('DIR_WS_IMAGES', 'images/');

 

If I manually upload the image to the images folder, everything works fine. So it seems to strictly be an uploading problem.

Share this post


Link to post
Share on other sites
Hi me again.

When I install the admin thumbnail option I've the problem that the language flags in the admin panel aren't showed. Normaly when you create a product you have these language flag left of the description field (for every installed language). I have there only a red cross (broken image link) and the text of the language (for example english).

 

Is the problem knowen? Is there a solution to solve it?

 

I did everything to install the contrib as mentioned in the instructions.

 

I'm sure the problem is within catalog/admin/includes/functions/html_output.php. There you have to replace the function tep_image with the same one that has to be replaced in catalog/includes/functions/html_output.php. But the original function in catalog/admin/includes/functions/html_output.php is much smaller than the one in catalog/admin/includes/functions/html_output.php. When I disable these function (and so disable the admin thumbnailing option) everything is fine.

 

 

Hi

 

I manage to fix this ! ..

 

in admin/includes/configure.php

 

look for

define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');

 

change it to

define('DIR_WS_CATALOG_LANGUAGES', '../includes/languages/');

 

This works for me but I'm not sure if it will cause other problems

Share this post


Link to post
Share on other sites
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.

Hello,

I installed this contribution today (mb 2.3b) I had similar problems that others seem to have had, but could not find a solution that worked for me. I have that big ugly no_image.jpg in my categories box. It only appears in the index.php (you can even see in the code where it says : <td height="14" class="infoBoxHeading"><img src="images/no_image.jpg" width="200" height="200" border="0" alt=""></td>

The image that normally would appear here, corner_right_left.gif, is right where it always is, but I can't find a way to fix this. I also commented out (/* // if no file exists display the 'no image' file

if (!is_file($src)) {

$src = "images/no_image.jpg";

}

*/

) as suggested on the thread. this had not affect.

 

Also, I am getting an error in the admin section. I thought if I changed the Thumbnail Path in Thumbnails, it might help. It just produced another error: Fatal error: Call to undefined function: tep_image_submit() in /home/creative/public_html/admin/configuration.php on line 133. This file doesn't seem to have changed but of course there is the change in the html_output.php files. I have removed the comments to see if this caused the second error, but it did not fix it.

Hope you can help,

Carol Ann Johnson

http://creativescrapbooksolutions.com/index.php

PS I have done nothing with the settings beyond the installation, but my pages are 10 times slower than before. I am assuming there is something yet to be done but of course do not want to proceed until the errors are gone.

Thanks in advance. :(

Share this post


Link to post
Share on other sites

Hi there,

 

Just downloaded and installed 2.3b, with a strange result.

 

I followed the instructions word for word and the thing seemed to work OK. However, the thumbnail images on my main store (/catalog) were all blurry/chunky. I was reading here about quality issues and none of the situations seemed to apply to me.

 

I did notice, however, that the thumbnails in my back end (/admin) looked great. Yes, I installed the separate product_thumb.php into my admin folder.

 

Putting 2 and 2 together, I simply copied the product_thumb.php from my admin folder into my catalog folder and boom, the main site thumbnails look great.

 

Im not a technical person so im not sure why or how this works, but if someone can figure it out, im sure others would be greatful.

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

×