Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

ThumbNails and WaterMarks OnTheFly


Recommended Posts

I don't see full path to your image.php file it should be like this(lime my server):

 

RewriteEngine         on
RewriteRule        ^(.*)\.jpg                /home/user12435/web/com/webdomain/www/watermark/image.php?%{REQUEST_FILENAME}

 

I contacted my host for the full path and changed the htaccess file to

 

RewriteEngine  on
RewriteRule	^(.*)\.jpg  /home/thecolla/public_html/catalog/images/image.php?%{REQUEST_FILENAME}

 

Unfortunately, I still get the same result. Broken images and then blank screen if I right click.

 

Rayzak - would you post a link to your site so I could see the contribution in action? Thanks

Link to comment
Share on other sites

  • Replies 87
  • Created
  • Last Reply

Top Posters In This Topic

Ok, you should create a watermark directory in the catalog root directory and copy all files in there.

 

After, fix the .htaccess and put it in to the images directory.

 

RewriteEngine  on
RewriteRule ^(.*)\.jpg  /home/thecolla/public_html/catalog/watermark/image.php?%{REQUEST_FILENAME}

 

Sorry, I got open issues with this contribution and I don't use it yet.

Link to comment
Share on other sites

Rayzak - would you post a link to your site so I could see the contribution in action? Thanks

Hey, you can always look ar Rob's site: http://www.russianglass.co.uk/

 

(Rob is the one who came up with this contribution, long ago)

If at first you don't succeed, you must be a programmer.

 

Tip Posted: Languageless Reviews

Link to comment
Share on other sites

Ok, you should create a watermark directory in the catalog root directory and copy all files in there.

 

Which files am I putting in the watermark directory? image.php and watermark.png?

 

Thank you for your assistance. :)

Link to comment
Share on other sites

  • 4 weeks later...

hey, how to handle 2 different thumbnail-sizes?

 

tried to add the following to .htaccess:

RewriteRule ^(.*)\.thumb thumb.php?%{REQUEST_FILENAME}

RewriteRule ^(.*)\.thumb640 thumb640.php?%{REQUEST_FILENAME}

 

then i uploaded a two files thumb.php (for 130*130) and thumb640.php (for 640*480).

 

then in product_info.php i changed 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>'; ?>');

---- to ---

document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE. ".thumb640", '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>'; ?>');

----

 

i also made the changes to html_output.php as described.

so now it works for 130*130 thumbs but not for the pop up window with the large images...

 

how can i fix this/get this working?

Edited by flom
Link to comment
Share on other sites

well i found out 2 things:

 

you have to change the line

$mimage=str_replace(".thumb",".jpg",$QUERY_STRING);

to

$mimage=str_replace(".thumb640",".jpg",$QUERY_STRING);

in thumb640.php

 

and the main problem is the .htaccess file:

because the first rule handles everything that has the following extensions:

 

.thumb

.thumb640

.thumbxy

.thumb123

etc

 

so the rewriterule thumb640 cannot do its job.

how to fix this?

 

quite easy:

just turn it around

 

RewriteRule ^(.*)\.thumb640 thumb640.php?%{REQUEST_FILENAME}

RewriteRule ^(.*)\.thumb thumb.php?%{REQUEST_FILENAME}

Edited by flom
Link to comment
Share on other sites

Flow, I've downloaded your edited version, but I have no clue as to how to install your changes. You have added the files popup_image.php - popup_image7.php. Your instructions only mention that I have to change something in these files, but not where I should put them. Also these 7 files make a database query, but the row isn't in the standard database, so you've forgot to add the SQL file/code to do that.

Link to comment
Share on other sites

you have to install the contribution "more pics" first.... in this file you can find the popup_image files...

Ah OK, I missed that that was essential. Do you mean this contribution?

Edited by computeramstelveen
Link to comment
Share on other sites

  • 1 month later...

Hi there,

 

I've got a problem to get this nice contrib to work.

 

I placed all files in /catalog/thumbs.

 

I edited the code in /includes/functions/html_out.php

so that all images are requested with the .thumb ending.

 

But now the rewrite rule in my htaccess seems to be the problem.

 

I already have a htaccess file, which makes my testsystem password-protected.

 

The content:

AuthUserFile /srv/www/test/.htpasswd
AuthType Basic
AuthName "am"
require valid-user

RewriteEngine on
RewriteRule ^(.*)\.thumb_big /thumbs/thumb_big.php?%{REQUEST_FILENAME}
RewriteRule ^(.*)\.thumb_medium /thumbs/thumb_medium.php?%{REQUEST_FILENAME}
RewriteRule ^(.*)\.thumb /thumbs/thumb.php?%{REQUEST_FILENAME}

 

But then I only get a 500 - Internal server error.

 

Please be so kind and give me some further advice to get this contrib working.

 

Thanks in advance,

Regards

Andreas

Link to comment
Share on other sites

  • 2 weeks later...

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