Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Image Resize v1.5


dreamscape

Recommended Posts

  • Replies 71
  • Created
  • Last Reply

Top Posters In This Topic

i have a litle problem with ImageResize 1.5 MS2

 

in the adminpanel i set:

thumbnail subdirectory: thumbs/

big image subdirectory: images_big/

 

the thumbnails were saved to images/ (thas no problem) - they are shown right.

the big images are saved to images/images_big/

but in the popup-window are the thumbnails showed.

 

if i let write the imagepath in the popup-window it looks correct but the shown img src ist wrong.

 

where can i fix this problem?

 

thx for help

Mathias

Link to comment
Share on other sites

http://www.directplastics.com/

 

This problem isn't related to Image Resizer, but it's stopping it working.

 

I have 'Image Required' set to 'false' in Admin so that broken images do not show for products that do not have images. With this set to 'false' the pop-up big image does not display, it justs opens an empty window. If I set 'Image Required' to 'true' everything works OK.

 

I had the same problem using Dynamic MoPics and couldn't track down the problem.

 

Could anyone suggest where to look for the cause of this?

 

Thanks.

David @ 1cog.

Link to comment
Share on other sites

I've solved the problem by replacing:

 

//echo tep_image($image, $products_values['products_name']);

 

with

 

echo '<img src="' . DIR_WS_IMAGES . $image_subdir . $products_values['products_image'] .  '" />';

 

However, I would really like to work out why I have got to do this with 'Images Required = False' and no one else.

David @ 1cog.

Link to comment
Share on other sites

in the adminpanel i set:  

thumbnail subdirectory: thumbs/

big image subdirectory: images_big/

 

the thumbnails were saved to images/ (thas no problem) - they are shown right.  

the big images are saved to images/images_big/  

but in the popup-window are the thumbnails showed.

 

I'm having exactly the same problem.

 

It appears the images directory is not registering. If I copy image location from the popup image, I get:

http://www.100megs22.com/~seafire/catalog/images/brannigans_special_ale1.png

 

Thanks,

 

Phil

Link to comment
Share on other sites

If you read page one, you would have seen that there is a problem with the popup_image.php.

 

to fix it, replace BIG_IMAGE_SUBDIR with DIR_FS_CATALOG_IMAGES_BIG in popup_image.php

 

the thumbnail dir is not used... but is just left over from the old version

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

Ok I get the same problem as Mathias and Seafire.

 

I have changed the BIG_IMAGE_SUBDIR to DIR_FS_CATALOG_IMAGES_BIG as you instructed above. I even tried changing it in general.php as I noticed it was in there too. But no I still get the little thumbs showing instead of the big picture. Please help as this is all that is holding my shop from going live.

 

Seafire, may I ask is the above all you did to get it working?

 

Thanks in advance.

Link to comment
Share on other sites

I actually made two changes in popup_image.php

 

First off, since I am running MS2, I noticed that some of the pathnames had changed from previous versions, so your mileage may vary.

 

BACKUP...BACKUP....BACKUP

 

I changed BIG_IMAGE_SUBDIR to DIR_FS_CATALOG_IMAGES_BIG and

DIR_FS_DOCUMENT_ROOT to DIR_FS_CATALOG and it worked!

 

So this:

 

<?php

 $image_subdir = BIG_IMAGE_SUBDIR;

 if (substr($image_subdir, -1) != '/') $image_subdir .= '/';

 

 // if you have problems showing the big image, remove the slashes and check the path

 // echo DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG . DIR_WS_IMAGES . $image_subdir . $products_values['products_image'];

 $image = ((is_file(DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG . DIR_WS_IMAGES . $image_subdir . $products_values['products_image'])) ? DIR_WS_IMAGES . $image_subdir . $products_values['products_image'] : DIR_WS_IMAGES . $products_values['products_image']);

 echo tep_image($image, $products_values['products_name']);

?>

 

became this:

 

<?php

$image_subdir = DIR_FS_CATALOG_IMAGES_BIG;

 if (substr($image_subdir, -1) != '/') $image_subdir .= '/';

 

 // if you have problems showing the big image, remove the slashes and check the path

//echo DIR_FS_CATALOG . DIR_WS_IMAGES . $image_subdir . $products_values['products_image'];



 $image = ((is_file(DIR_FS_CATALOG .  DIR_WS_IMAGES . $image_subdir . $products_values['products_image'])) ? DIR_WS_IMAGES . $image_subdir . $products_values['products_image'] : DIR_WS_IMAGES . $products_values['products_image']);

 echo tep_image($image, $products_values['products_name']);

?>

 

Hope this helps

 

Phil

Link to comment
Share on other sites

Hello,

 

I've got a problem the thumbnails are not copied into the destination dir.

 

If I set the debug on true it says:

 

target_small: /var/www/l3s4371/html/shop/images/wanda.jpg 

Resizing small image 

Starting in_resize_image() 

temp_pic:/var/www/l3s4371/phptmp/phpDemli6 

image_new:/var/www/l3s4371/html/shop/images/wanda.jpg 

width:201 



Image has to be resized; checking for gd-lib 



GD-Lib found start resizing 

Image Format:2 



Generated new SRC-Pic 

GD-LIB 2 - Generated new Pic 



target_big: /var/www/l3s4371/html/shop/images/images_big/ 

Copying big image 

Success: File upload saved successfully.

 

Can anyone help me please ??

 

Stefan

Link to comment
Share on other sites

if you read above thumbs dir is not used anymore. I think this is so MS2 can get it from the main dir if something goes wrong.... But I think it should be round the other way.... A thumbs dir but no image_big dir.....

Link to comment
Share on other sites

Hi, i?am new to oscommerce and the image resize contribution. And now my question about this combination:

When i delete a Produkt from the stock in the admin module, the thumb will be removed but the big image is still there.

Is there a way that the big images is also removed from the server automatically?

 

brgds

 

Jan

Link to comment
Share on other sites

Hi, i?am new to oscommerce and the image resize contribution. And now my question about this combination:

When i delete a Produkt from the stock in the admin module, the thumb will be removed but the big image is still there.

Is there a way that the big images is also removed from the server automatically?

 

brgds

 

Jan

 

In the install instructions there were some lines to add to admin/includes/functions/general.php that should delete the big image when you delete a product... it should work... ahh I see...

 

I forgot to put in the new images_big directory variable in place of the old.

 

To get the big images to delete in that code you place in general.php for the admin, change from:

    if ($duplicate_image['total'] < 2) {

     if (file_exists(DIR_FS_CATALOG_IMAGES . $product_image['products_image'])) {

       @unlink(DIR_FS_CATALOG_IMAGES . $product_image['products_image']);

     }

  $image_subdir = BIG_IMAGE_SUBDIR;

  if (substr($image_subdir, -1) != '/') $image_subdir .= '/';

     if (file_exists(DIR_FS_CATALOG_IMAGES . $image_subdir . $product_image['products_image'])) {

       @unlink(DIR_FS_CATALOG_IMAGES . $image_subdir . $product_image['products_image']);

     }

   }

 

to:

    if ($duplicate_image['total'] < 2) {

     if (file_exists(DIR_FS_CATALOG_IMAGES . $product_image['products_image'])) {

       @unlink(DIR_FS_CATALOG_IMAGES . $product_image['products_image']);

     }

  $image_subdir = DIR_FS_CATALOG_IMAGES_BIG;

  if (substr($image_subdir, -1) != '/') $image_subdir .= '/';

     if (file_exists(DIR_FS_CATALOG_IMAGES . $image_subdir . $product_image['products_image'])) {

       @unlink(DIR_FS_CATALOG_IMAGES . $image_subdir . $product_image['products_image']);

     }

   }

 

there that should be deleting them now... sorry about that...

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

if you read above thumbs dir is not used anymore. I think this is so MS2 can get it from the main dir if something goes wrong....  But I think it should be round the other way.... A thumbs dir but no image_big dir.....

 

well the way osCommerce works is it gets the thumbnail images from the main dir... nothing really I can do about that other than petition the dev team to change it so the thumbs are in their own subdir by default.

 

you *can* put thumbs in a subdir if you include that in the filename (like upload: c:my picsmy storethumbs/picture.jpg"... BUT, that makes the filename "thumbs/picture.jpg" which would really complicate things for the image resize because it would want to put the big image in "images_big/thumbs/picture.jpg"... which makes no sense... NOW, if the images are in category sub-folders then this does make sense and will keep you organized:

 

thumbnail: "dvds/picture.jpg"

big image: "images_big/dvds/picture.jpg"

 

Information on how to upload images (thumbnails) into their own subdir:

http://wiki.oscommerce.com/helpHowtoUploadImages

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

I just installed this contribution to a fresh install of MS2. I was very careful to double check all before I uploaded. I've backed up, but I really need this to work, as the images are really a mess with the standard version (thumbnails are squished)

 

Here's the error I'm getting:

 

Fatal error: Call to undefined function: tep_admin_check_login() in /home/cauiola/public_html/admin/includes/application_top.php on line 213

 

I find this odd as I did not touch the app_top file at all. Only the files listed and uploaded the sql mod. The admin is broken not the store itself.

 

Help would be much appreciated.

Link to comment
Share on other sites

  • 2 weeks later...
(thumbnails are squished)

 

... and they apparently are the same filesize as the big images, which is no good. You need to get this to work. Not being a programmer, the only encouragement I can give you is that I've got this going fine after much messing about and checking my code with a fine toothed comb. In fact once I've uploaded an image and got it reduced into the images folder (and I agree - they really need their own folder) I then upload a new version of the thumbnail over the old one, in my case with a version of the image that displays better as a thumbnail.

 

Regards,

 

Patrick

Link to comment
Share on other sites

http://www.directplastics.com

 

Well, everything was working fine but now the store owner reports he cannot upload images via Admin. I have no idea what could have changed to cause this - I haven't touched the code for several weeks.

 

When an image is added to a product in Admin, click 'Preview', the image shows as broken:

 

<img src="/images/" border="0" alt="20x1 Frame Packers (per 100)" title=" 20x1 Frame Packers (per 100) " width="100" height="75" align="right" hspace="5" vspace="5">

 

The image filename is not being populated. I tried adding an echo to categories.php:

 

// copy image only if modified



       $products_image = new upload('products_image');

echo $products_image;

 

This returns the word 'Object'. Should it not show the image filename???

 

I've uninstalled, reinstalled three times. Read this thread twice and none the wiser.

 

Help or suggestions very welcome. :?

David @ 1cog.

Link to comment
Share on other sites

I just installed this contribution and I don't see anything different in my control panel.

 

What I am trying to accomplish is this:

 

Upload a normal image whatever x 400 in size, but on the category page I would like it to be resized to 25% proportionally. So there is a thumbnail on the category page and when you click to enlarge it really does.

 

As it stands right now I have a thumbnail uploaded as the first picture which I have resized before uploading, but when I click to enlarge it doesn't. It didn't before I added this mod either.

 

So then I upload another image (using the additional image mod) where I can upload a normal size picture & thumbnail. But I look like a moron with 2 images both saying "click to enlarge"

 

For an example of what I mean, you can look here:

 

http://www.elegantdepressionglass.com/cata...&products_id=31

 

Setting the images to a certain height in the control panel doesn't resize them in proportion, I've already tried that.

 

Am I looking in the wrong place for this?

Link to comment
Share on other sites

This worked for me (using osCommerce 2.2 Milestone 2)

 

I was unable to display the large picture, when clicking

to enlarge.

 

Start with the catalog/popup_image.php file that comes with

Image Resizer 1.5, make the 2 changes noted:

basically, removing references to DIR_FS_DOCUMENT_ROOT

and DIR_WS_CATALOG . Change 1 is optional, because

it is a change to a comment.

 

 

<body onload="resize();">

<?php

$image_subdir = DIR_FS_CATALOG_IMAGES_BIG;

if (substr($image_subdir, -1) != '/') $image_subdir .= '/';

 

// if you have problems showing the big image, remove the slashes and check the path

// change 1: change next line to

// echo DIR_WS_IMAGES .$image_subdir . $products_values['products_image'];

 

//change2 change: the $image= line to this:

$image = ((is_file(DIR_WS_IMAGES . $image_subdir . $products_values['products_image'])) ? DIR_WS_IMAGES . $image_subdir . $products_values['products_image'] : DIR_WS_IMAGES . $products_values['products_image']);

echo tep_image($image, $products_values['products_name']);

?>

</body>

Link to comment
Share on other sites

  • 4 weeks later...

Hello, I have additional images ms2 installed on my cart. When I installed the image resize mod. it worked ok except that the additional images are now the same size as the pop ups. Which is the size that I uploaded. They are shrunk to the predefined size.

 

Any suggest.

Link to comment
Share on other sites

Hi There - I'm trying very had to get this contribution to work. I've read through ALL of the posts in this forum an made all the recommended changes. It would help if I could look at the debug file, but I don't know how where to find it. Any advice?

 

I've created images_big under the images directory, but not pictures are showing up there (yes, I've changed the BIG_IMAGE_SUBDIR directory to DIR_FS_CATALOG_IMAGES_BIG, and DIR_FS_DOCUMENT_ROOT...etc.)

 

The only other conflict I could see is with the WYSIWYG HTMLArea MS2 v1.7 contrib that I have installed. Has anyone had problems with this contrib and the Image Resize v1.5 together?]

 

Thanks - Ryan

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