Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] oscThumb


Guest

Recommended Posts

  • Replies 443
  • Created
  • Last Reply

Top Posters In This Topic

Also just to let you know i have swapped the reviews box to the left column and it works fine. Rather it on the right side but its not the end of the work if it cant be done :)

I was going to ask you to check the size of the image in the box reviews (mine is SMALL_IMAGE_WIDTH and SMALL_IMAGE_HEIGHT) and check the values in the configuration, but if it works on the left side is because it is correctly set... I disabled the reviews on my shop because people were using it to make questions instead of ratin the products, but I added it back and it displays correctly on the left and right sides...

 

Please try to display the picture size value in the box to see if it displays correctly on the left and the right size. Add

echo "Width: ". SMALL_IMAGE_WIDTH . " - Height: ".SMALL_IMAGE_HEIGHT;

before:

$info_box_contents[] = array('text' => '<div align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&reviews_id=' . $random_product['reviews_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></div><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&reviews_id=' . $random_product['reviews_id']) . '">' . $review . ' ..</a><br><div align="center">' . tep_image(DIR_WS_IMAGES . 'stars_' . $random_product['reviews_rating'] . '.gif' , sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $random_product['reviews_rating'])) . '</div>');

in the includes/boxes/reviews.php file!

 

Maybe you are also setting the SMALL_IMAGE_WIDTH and/or SMALL_IMAGE_HEIGHT to the same size of the product info image (somewhere in the product_info.php file).

Link to comment
Share on other sites

I have installed the oscThumb contribution. It works pretty well. However, I have a couple of quirks with the text watermark feature. I have been trying to hunt down solutions but, so far, no luck. Hopefully, someone can point me in the right direction.

 

Quirk #1: “Text Watermark Position” is set to “Top.” However, the text watermark actually appears in the lower right. When trying to change the position in the admin, I get the following error when clicking on the edit button:

 

Fatal error: Call to undefined function tep_cfg_pull_down_watermark_alignment() in /home/mysite/public_html/admin/configuration.php(125) : eval()'d code on line 1

 

Quirk #2: I have changed the product_info.tpl.php to now use PRODUCT_INFO_IMAGE_WIDTH and PRODUCT_INFO_IMAGE_HEIGHT. So, the size of the image that appears on the individual product page is now controlled by the “Product Information Image” settings in configuration/image. However, the appearance of a text watermark on the image that appears on the individual product page is controlled by the “Text Watermark in Pop-up Images,” and not by “Text Watermark in Product Information Thumbnails.” The image that appears on the individual product page seems to also use the settings for pop-up images and not the control settings for product information images. How do I get the text watermark to appear on the pop-up image but not the image that appears on the individual product page? Similarly, how do I get a frame to appear around the pop-up image without also appearing around the image that is on the individual product page?

 

(“Text Watermark in Small Thumbnails” seems to work fine, It does control the appearance of the text watermark on the product images on the category/subcategory listings.)

 

Quirk #3: When I click to edit the “Text Watermark Font Name” setting, I get the following error:

 

Fatal error: Call to undefined function tep_cfg_pull_down_installed_fonts() in /home/mysite/public_html/admin/configuration.php(125) : eval()'d code on line 1

 

Quirk #4: Changing the “Text Watermark Size” setting has no impact on the size of the text watermark.

Link to comment
Share on other sites

Its working but the review image is resizing with the product image but only on the product info page.

If there are no reviews or if you are a catagory page then its fine.

 

(...)

I was writing here how to solve this problem. Go back to my posts.

Link to comment
Share on other sites

Hello

I just installed oscthumb .

It is very effective, in fact, pages with many images that weighed 3200 kb are found a 650 kb.

However, I notice that some images are not resized. Only a few.

They are displayed at their actual size and shift the whole site.

Manufacturer Info example, an image that is 650 px wide is displayed in miniature is no problem, while another image that has only 300 px wide as it appears and shifts the whole column.

There is nothing that differentiates these 2 pictures and there are no accented characters or other errors in the name.

At about 1300 articles, there are 4 or 5 images that also appear in actual size.

The I also see no error in these images.

Does anyone had this problem?

Or an idea of why!

I am in local with WampServer is what's has this?

 

Excuse my bad english

 

Thank you

Francois

Link to comment
Share on other sites

I have installed the oscThumb contribution. It works pretty well. However, I have a couple of quirks with the text watermark feature. I have been trying to hunt down solutions but, so far, no luck. Hopefully, someone can point me in the right direction.

 

Quirk #1: “Text Watermark Position” is set to “Top.” However, the text watermark actually appears in the lower right. When trying to change the position in the admin, I get the following error when clicking on the edit button:

 

Fatal error: Call to undefined function tep_cfg_pull_down_watermark_alignment() in /home/mysite/public_html/admin/configuration.php(125) : eval()'d code on line 1

 

Quirk #2: I have changed the product_info.tpl.php to now use PRODUCT_INFO_IMAGE_WIDTH and PRODUCT_INFO_IMAGE_HEIGHT. So, the size of the image that appears on the individual product page is now controlled by the “Product Information Image” settings in configuration/image. However, the appearance of a text watermark on the image that appears on the individual product page is controlled by the “Text Watermark in Pop-up Images,” and not by “Text Watermark in Product Information Thumbnails.” The image that appears on the individual product page seems to also use the settings for pop-up images and not the control settings for product information images. How do I get the text watermark to appear on the pop-up image but not the image that appears on the individual product page? Similarly, how do I get a frame to appear around the pop-up image without also appearing around the image that is on the individual product page?

 

(“Text Watermark in Small Thumbnails” seems to work fine, It does control the appearance of the text watermark on the product images on the category/subcategory listings.)

 

Quirk #3: When I click to edit the “Text Watermark Font Name” setting, I get the following error:

 

Fatal error: Call to undefined function tep_cfg_pull_down_installed_fonts() in /home/mysite/public_html/admin/configuration.php(125) : eval()'d code on line 1

 

Quirk #4: Changing the “Text Watermark Size” setting has no impact on the size of the text watermark.

For questions 1 and 3, the missing functions should be on catalog\admin\includes\functions\general.php. Check if you have add them.

 

For question 4, on my case the default font when I imported the SQL file into the database was missing. For sure it will be also your case, so after adding the missing functions and after changing the font to an existing one it might work (I haven't test it myself).

 

For question 2, the setting for each image type is done in function _get_params. You might need change something here if it is not working for you. It takes into account the image type defined in the fucntion set_size, depending on the image width and height. To have the frame just in the popup image, you may need to add new settings in the database and then change accordingly in the function _get_params. As an example, you may add a new setting to (de)activate frames for popup images and then in the _get_params change:

      case 5:  // Popup.
     if (FRAME_POPUP=="Yes") $frame=true;
     if (BEVEL_POPUP=="Yes") $bevel=true;
     if (USE_WATERMARK_IMAGE_POPUP =="Yes") $image_watermark=true;
     if (USE_WATERMARK_TEXT_POPUP =="Yes") $text_watermark=true;
     $quality=(int)POPUP_JPEG_QUALITY;
     break;

into

      case 5:  // Popup.
     if (PUT HERE THE NEW ACTIVATION FLAG FOR FRAMES IN POPUP=="Yes") $frame=true;
     if (BEVEL_POPUP=="Yes") $bevel=true;
     if (USE_WATERMARK_IMAGE_POPUP =="Yes") $image_watermark=true;
     if (USE_WATERMARK_TEXT_POPUP =="Yes") $text_watermark=true;
     $quality=(int)POPUP_JPEG_QUALITY;
     break;

Link to comment
Share on other sites

Hello

I just installed oscthumb .

It is very effective, in fact, pages with many images that weighed 3200 kb are found a 650 kb.

However, I notice that some images are not resized. Only a few.

They are displayed at their actual size and shift the whole site.

Manufacturer Info example, an image that is 650 px wide is displayed in miniature is no problem, while another image that has only 300 px wide as it appears and shifts the whole column.

There is nothing that differentiates these 2 pictures and there are no accented characters or other errors in the name.

At about 1300 articles, there are 4 or 5 images that also appear in actual size.

The I also see no error in these images.

Does anyone had this problem?

Or an idea of why!

I am in local with WampServer is what's has this?

 

Excuse my bad english

 

Thank you

Francois

I also use WAMPServer and I never saw this problem. All images that go through tep_image function should be thumbnailed.

 

Br

Link to comment
Share on other sites

Great add-on, installed easily and works great! Just one question: I have a few animated GIFs as product images. When these get thumbnailed they are also getting flattened to the first image in the animated sequence. Is there any way to either:

 

* Fix it so the animated GIFs get scaled without clobbering them, or

* Turn off thumbnailing on a per-product basis?

 

Thanks!

 

-ch

Edited by hyperion917
Link to comment
Share on other sites

Hello

Thank's for your response.

The images measure eg 270 wide by 80 high are not resized.

We must put a size square or nearly square 270 and 250 by example and it work.

I tested on the original images that displayed wrong and she had a big difference between the width and height.

If I reduced the difference, although it appears in miniature.

 

is this normal or should we setting anything, or to change the code .

Thank you

Francois

Edited by francois21
Link to comment
Share on other sites

Hello

Thank's for your response.

The images measure eg 270 wide by 80 high are not resized.

We must put a size square or nearly square 270 and 250 by example and it work.

I tested on the original images that displayed wrong and she had a big difference between the width and height.

If I reduced the difference, although it appears in miniature.

 

is this normal or should we setting anything, or to change the code .

Thank you

Francois

 

I'm having the same problem....I didn't think to check the difference between the height and width of the images but now that you have me thinking about that, it might well be the problem in my situation too. I'll investigate this a little more and see if that is indeed what is happening....dan

Link to comment
Share on other sites

Hello

Thank's for your response.

The images measure eg 270 wide by 80 high are not resized.

We must put a size square or nearly square 270 and 250 by example and it work.

I tested on the original images that displayed wrong and she had a big difference between the width and height.

If I reduced the difference, although it appears in miniature.

 

is this normal or should we setting anything, or to change the code .

Thank you

Francois

 

 

Francois...you're indeed correct...that is exactly what the problem is. Getting it fixed would be ideal but at least there is a work around....I also noticed that it only seems to happen with those images where one of the dimensions is less than the size that you specify for the thumb....ie if my thumb is set for 100 X 100 and the image is 97 X 350...its a problem. If I move the image size to 100 X 350 it works fine or if I change the thumb size setting to say 80 X 100 it works.

 

Does that hold true in your install as well?

 

Dan

Link to comment
Share on other sites

Francois...you're indeed correct...that is exactly what the problem is. Getting it fixed would be ideal but at least there is a work around....I also noticed that it only seems to happen with those images where one of the dimensions is less than the size that you specify for the thumb....ie if my thumb is set for 100 X 100 and the image is 97 X 350...its a problem. If I move the image size to 100 X 350 it works fine or if I change the thumb size setting to say 80 X 100 it works.

 

Does that hold true in your install as well?

 

Dan

Yes

if all originals images are 400 X 400 for example, all is good. all images are resizing to 100 X 100 (size of my small images)

 

so if one images is 50 X 400 (a pencil) this image is not resizing .

 

Francois

Link to comment
Share on other sites

Thnks for this nice contribution.

 

With oscThumb installed, I found that It does not works If "Encrypt Image Filenames" is set to "true" in admin. (It did not popup in products_info page when clicked thumbnail images).

 

After I have tried to do following hacks in [jquery.fancybox.js], it works.

 

----------------------------------------------------

==>Find

, imageRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i;

 

and replace it with:

 

, imageRegExp = /(jpg|gif|png|bmp|jpeg)(.*)?$/i;

----------------------------------------------------

 

Hope it helps!

Link to comment
Share on other sites

Hello

I installed More Pics 6 and oscthumb and lightbox.

Everything works, but I have a problem with the watermark oscthumb.

On the pictures of product_info the product image has the watermark and the lightbox too.(thank's Spook)

The additional images of more pics have no watermark, but when you click the popup has the watermark.

How to have the watermark on images more pics

Thank you

Francois

Link to comment
Share on other sites

Hi,

 

i just installed this contribution and it works great, except for one thing.

 

all of my product images on the site work fine except one. instead of the image showing up this shows up in its place.

 

oscthumb.png

 

anyone have a clue what this is or why it only does this to one product.

Link to comment
Share on other sites

I am having trouble getting with the text watermark. When It is enabled, the image that it is enabled for does not show.

 

Any ideas?

Like, it works on my wampserver. On the webserver, if text watermark is not set, the images show.

 

I have followed instructions to the best of my understanding.

 

I have read the posts in this thread.

 

Encrypt Image Filenames" is set to "false".

 

All images have a height of about 500 px, but with the image size set at 140, even the normal product images do not show if text matermark is on.

 

Cache is set to true in admin, oscThumb uses the same directory as set in cache in admin.

Link to comment
Share on other sites

Hi,

 

i just installed this contribution and it works great, except for one thing.

 

all of my product images on the site work fine except one. instead of the image showing up this shows up in its place.

 

oscthumb.png

 

anyone have a clue what this is or why it only does this to one product.

Is the filename correct?

Link to comment
Share on other sites

you have to take more care when u install, many manage to repeat thier same mistakes every time they try, only when they look back afresh do they see their errors, I've gone to fix peoples installs where they insist they have done it all perfect, but when I find there missing files/edits, they say oh I was in a rush then/ the phone rang/ I thought that bit did'nt matter!! .....

 

I've installed this on quite a number of servers, never had your issue, please check your edits again. smile.gif

 

Sam, I also am having the problem of no images and the alt text showing. In my case the text does not wrap and expands the image box so that where ever an image is to be displayed, left column, right column, etc, the page is distorted so much it is too wide for the screen. I am using your center page addon by the way with the default page width.

 

Generally it goes with me that if Spooks says it's so, it's so. Or a very high probability thereof. Anyway, I just did my third reinstall of oscThumb and all end up with the same problem as decribed. Could the problem be my install....yea. A lot of years ago, and I mean a lot of years ago I could have been the poster child for ADD.

 

My hunch is that I am good on my install but I am going to let this sit for a while and come back at it again fresh. I have made sure my setting are as recommended...no encryption, etc. My admin cache is off. All that.

 

I'll see what a time out and revisit can do. In the meanwhile I am switching this off so the pages aren't balled up.

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

  • 2 weeks later...

Thank for your contrib! I have installed on my localhost, it works very well and have some questions:

 

1. How does it protect the image? watermark and encrypt file name? I still can use "save image as..." command and save to local PC and open it. How can protect that user cannot save the image?

2. How to get this image url: http://localhost/shoptest/oscthumb.php?src=kNXSwNvN1J3JzszC1ZPJ5M8.&w=1000&h=1440&f=jpg&q=100&hash=da3e9c93979ed352af1afecb5b530533 on product_info.php page?

3. If i want to embed an image with <img src="img_path"> tag, how can we encrypt this img_path on product_info.php page? just using tep_image() function?

4. My main question, if we know the product_id, how can we get the encrypt filename of its image?

 

thanks for your help

Link to comment
Share on other sites

Thank for your contrib! I have installed on my localhost, it works very well and have some questions:

 

1. How does it protect the image? watermark and encrypt file name? I still can use "save image as..." command and save to local PC and open it. How can protect that user cannot save the image?

2. How to get this image url: http://localhost/sho...f1afecb5b530533 on product_info.php page?

3. If i want to embed an image with <img src="img_path"> tag, how can we encrypt this img_path on product_info.php page? just using tep_image() function?

4. My main question, if we know the product_id, how can we get the encrypt filename of its image?

 

thanks for your help

 

 

If you install this & have encrypt file name enabled then that will apply to product_info.php as well

 

The purpose of the watermark is to protect the image, you cannot stop it being saved, after all, to be displayed in the browser it must be saved on the local machine already, so any save disable can be bypassed by searching the cache, or they can just use print screen etc etc.

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.

Link to comment
Share on other sites

If you install this & have encrypt file name enabled then that will apply to product_info.php as well

 

The purpose of the watermark is to protect the image, you cannot stop it being saved, after all, to be displayed in the browser it must be saved on the local machine already, so any save disable can be bypassed by searching the cache, or they can just use print screen etc etc.

 

Hello Sam,

thank you for your post. Could you help me 4. My main question, if we know the product_id, how can we get the encrypt filename of its image? (write a new .php file)

Link to comment
Share on other sites

Hello Sam,

thank you for your post. Could you help me 4. My main question, if we know the product_id, how can we get the encrypt filename of its image? (write a new .php file)

 

 

As you don't say what your trying to do I cant give a precise answer, but if you look at the code in Simple Multi Image Add-on (Un-Limited) with Fancy Popups http://addons.oscommerce.com/info/7008 that is done as part of that, perhaps you can work it out from there.

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.

Link to comment
Share on other sites

As you don't say what your trying to do I cant give a precise answer, but if you look at the code in Simple Multi Image Add-on (Un-Limited) with Fancy Popups http://addons.oscommerce.com/info/7008 that is done as part of that, perhaps you can work it out from there.

Hello Sam,

Okay, this is what I want. If I want to get the image path of a product from its product id (=1234 for example): get_image.php?proId=1234

//connect database
$product_info_query = tep_db_query("select p.products_image from " . TABLE_PRODUCTS . " p where p.products_id = '" . $_GET['proId'] . "'");

$product_info = tep_db_fetch_array($product_info_query);

$filePath= DIR_WS_IMAGES . $product_info['products_image'];

 

So It will return the products_image, and it is not encrypted. My question is how can we get the encrypt file name from oscthumb?

 

Could you show me a demo of website using Simple Multi Image Add-on and oscThumb?

 

BTW, on Simple Multi Image Add-on, there is a field products_image_array. Can you show an example of its value?

 

thank you for your great help.

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