Jump to content
Sign in to follow this  
adam_gardner

Problem With Mike Davis Distortion Fix

Recommended Posts

hi all, i've searched the forums for this but can't find it anywhere, i've installed the image distortion fix from mike davis.

 

the problem is that I can't get the big images to work, i.e. when i click on, "Click To Enlarge" it just gives me a red cross :-( !!

 

anyone help with this?

 

for a better view of this, visit my site - www.lumoslighting.co.uk/cart (click any product then in the description, click on "Click To Enlarge"

 

 

Hoping for a prompt reply :- below is the installation instructions for the distortion fix :-

 

This is the best fix to the problem with product images being distorted.

This worked fine in osCommerce 2.2 Milestone 2 (07/12/2003).

Before you start, you'll need software to convert ALL of your original images to thumbnails. I recommend EZ Thumbnails although you can use any other software.

You can download EZ Thumbnails at http://www.fookes.com/ezthumbs/?Easy%20Thumbnails=2600

****Back Up ALL product images****

1. Upload all thumbnails to the normal directory 'catalog/images'.

2. Create a NEW directory called 'BIG'. USE UPPERCASE LETTERS WHEN NAMING DIRECTORY!

3. Upload ALL original size files (that you backed up) to the new "BIG" folder.

4. Open the file: '/includes/configure.php'

5. FIND: 

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

6. REPLACE WITH:

define('DIR_WS_IMAGES', 'images/'); 
define('DIR_WS_IMAGESBIG', DIR_WS_IMAGES . 'big/');

7. Open the file: 'catalog/popup_image.php'

8. FIND:

<?php echo tep_image(DIR_WS_IMAGES . $products_values['products_image'], $products_values['products_name']); ?>

9. REPLACE WITH:

<?php echo tep_image(DIR_WS_IMAGESBIG . $products_values['products_image'], $products_values['products_name']); ?>

You're done!

***When adding new products through admin, ALWAYS upload the THUMBNAIL size pic. Be sure to MANUALLY upload ALL original size pics to the BIG directory.***

 

 

Adam

Share this post


Link to post
Share on other sites
Guest

I haven't tried the fix yet, but I think the problem is this:

Create a NEW directory called 'BIG'. USE UPPERCASE LETTERS WHEN NAMING DIRECTORY!

Because depending on your web server, directories are case sensitive. So if you are naming a directory BIG and the script then looks for this

define('DIR_WS_IMAGESBIG', DIR_WS_IMAGES . 'big/');

It won't find the "big" images on the server.

 

I wonder if you rename your directory to "big" all lowercase if the problem goes away.

 

On a side note, I'm going to install the fix myself because this is what I need for a project I'm working on and I'll post what I get for results...

 

-

Share this post


Link to post
Share on other sites
Guest

I'm working on a patch b/c I installed the MOPICS tweak which allows you to show 7 product images instead of one. And, it replaces the original popup_image.php file.

 

So, I don't have the following line of code any longer:

8. FIND:

 

<?php echo tep_image(DIR_WS_IMAGES . $products_values['products_image'], $products_values['products_name']); ?>

 

9. REPLACE WITH:

 

<?php echo tep_image(DIR_WS_IMAGESBIG . $products_values['products_image'], $products_values['products_name']); ?>

 

You're done!

 

So, I'm not done. I'm not sure if I'll be able to work it or not because the MOPICS tweak adds 6 more files called popup_image1.php , popup_image2.php etc...

 

-I'll post today if I get it.

-

Share this post


Link to post
Share on other sites
Guest

My files are hacked a bit differently because of the MOPICKS but try renaming your directory to "big" and move it and any pictures into the "images" directory.

 

It worked for me :) and I think it would have worked with out the difference in the popup_image.php code.

 

Post your results here.

 

-

Share this post


Link to post
Share on other sites

hmm, ok i've changed its name to "big" and moved the "big" folder, with all the original images inside, into my images folder (so my directory structure now reads - / cart / images / big

 

still not working, question though, my thumbnail pics (the ones i uploaded via admin panel) have a tn_ prefix .. so my images would be .. tn_IMG_7004.jpg

 

and the full size images have no prefix .. so just IMG_7004.jpg

 

I thought about this so i renamed one of my big pics to tn_.... and it's still not working

 

here's a direct link to the product that has both the thumbnail pic and the big pic with the prefix tn_

 

http://lumoslighting.co.uk/cart/product_in.../products_id/65

 

 

i hope you understood that lol ^^^^

 

congrats on it workign for you lol!

 

adam

Share this post


Link to post
Share on other sites
Guest

Hi Adam,

 

I took a look at some of the code on your site and your server directories...

 

Try renaming the directory again. It looks like the change didn't stick. Right now the directory inside your images is still called BIG.

 

If you click on your product image to get that popup window to open... right click in that window and "view source"

 

You'll see that the script we're using wants the images to be in a directory called, "big" - I'm not sure why the author emphasized the naming of the directory to be capitalized.

 

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html dir="LTR" lang="en">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>Mains GU10 240v Recessed Downlight</title>

<base href="http://lumoslighting.co.uk/cart/">

<script language="javascript"><!--

var i=0;

function resize() {

? if (navigator.appName == 'Netscape') i=40;

? if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+60-i);

? self.focus();

}

//--></script>

</head>

<body onload="resize();">

<img src="images/big/" border="0" alt=""></body>

</html>

 

To test it, I renamed my directory, to "BIG" and it broke the function on my site. So I had to put it back to "big" and all is well again.

 

 

 

***I did forget to mention that the image files all have to have the same file name. So, I created a separate folder on my PC called thumbnails and will put the thumbs in there and the full size images in the parent folder.

 

The other peskly thing I noticed is OSC wants to resize your thumbnails to approx. 100px wide to 80px high. But, what if your product doesn't reduce to exactly 100x80? And your product doesn't look good out of proportion(like my client's)?

 

Then you have to use an image editor to add white space on the sides that are short. (if that makes sense)

 

-cheers.

 

If this doesn't work out for you, let me see the two files that are modified with this and I'll see if I spot something... :)

-

Edited by MaineWebworks

Share this post


Link to post
Share on other sites
Guest

Adam & anyone following this thread,

 

I found an important fix to the original modification shown in the first post. In the ORIGINAL popup_image.php file in oscommerce-2.2 ms2, the line that is to be modified as instructed is slightly different.

 

The instructions as it appears in the Modification above:

7. Open the file: 'catalog/popup_image.php'

8. FIND:

<?php echo tep_image(DIR_WS_IMAGES . $products_values['products_image'], $products_values['products_name']); ?>

 

However, the line is actually written as:

<?php echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name']); ?>

 

 

So, step #9. REPLACE WITH,

<?php echo tep_image(DIR_WS_IMAGESBIG . $products_values['products_image'], $products_values['products_name']); ?>

 

now needs to be modified to reflect the actual code found in the original popup_image.php (2.2 ms2 ). The modified code is,

<?php echo tep_image(DIR_WS_IMAGESBIG . $products['products_image'], $products['products_name']); ?>

 

 

I discovered this b/c I realized that I didn't need the MOPICS solution and reinstalled my backups. I also compared my backups to the original oscommerce files to be sure I didn't mess anything up. At first, the BIG images modification didn't work and after finding this small difference in the code, I fixed it, tested it, and it works beautifully now. The new directory still has to be named "big" - small letters.

 

-

 

The other configuration I did to complement this is found here:

http://forums.oscommerce.com/index.php?showtopic=173567&hl=

 

It corrects the thubmnail distortion caused by the default image sizes set in OSC, via the Admin panel.

 

-

Share this post


Link to post
Share on other sites

yes!

 

finally got it working

 

yes, that fix mentioned by maine works a treat (don't do what I did and forget to rename your BIG directory to 'big' - lower case.)

 

also, remember to make sure ALL your images, whether BIG or small are named the same (if you use the thumbnail program the author of the hack recommends, the thumbnails are named tn_imagename.jpg

 

 

Thanks a load mate!

 

adam

Share this post


Link to post
Share on other sites
Guest
(if you use the thumbnail program the author of the hack recommends, the thumbnails are named tn_imagename.jpg

 

 

I've been using this resizer for some time now. Here's a link to the newest version. http://www.virtualzone.de/resizer/

 

It works great because, you can decide what to rename the files, where to save the files, how to resize them, and at what quality. B)

 

cheers!

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
Sign in to follow this  

×