chrometweaks.org

Tell me some thing about shared web iPage hosting service?

Click Here To View All Answers...


My question is Tell me some thing about shared web iPage hosting service? Many thanks for any response. Second question of mine... If I upload an image that is 1280 x 960 (1.3 Mp) OSCommerce will resize the picture smaller for the thumbnails, But is there a way to make OSCommerce resize the image "on the fly" to 640 x 480 if someone clicks on the "click to enlarge" link???.

I have seen some contributions that will allow you to upload 3 diffrent sized images, but this is obversally hard work when there might be a script that will do it automatically for you..

Many Thanks.

Dave..

Comments (217)

Hmm... I need to find out myself. I don't know what is the right answer to your question. I'll do some poking around and get back to you if I find an answer. You should email the people at iPage as they probably could give you help..

Comment #1

Check out the JPG Thumbnailer contribution in contributions. You can specify a size it will resize the image on the fly on the server. However, I would highly recommend not using images of that size on your site. Even resizing them down to 640x480 will make your iPage site extremely slow. If you have to use something that big, I would say get a good web image editor and slice the image up into smaller parts...

Comment #2

I tried this contrib and can't get it to work at all..

I made a bunch of odd size clear boxes and made everything about the sight outta wack...

Comment #3

There is more than one try another - also you need to have GD on the server check with your host...

Comment #4

Thanks for all of your help on this matter!.

I found that the contrubutions about at the moment require you to upload 3 images or they make 3 images from the image that you upload, what would be ideal is to have a script that resizes the image when you upload, to make the uploading images "foolproof" as it were..

I have GD Installed on my server as I run my sites on my persional server at home, Its cheeper and has less restrictions ;-).

I also have installed the "Crimages" contrubition, this watermarks your popup image on the fly (Recomended) So this makes it very hard to install any of the contrubutions that mod the catalog side of things..

Does anyone use this sort of resizing???.

Kind Regards.

Dave..

Comment #5

We use a resizer which resizes when we upload the images. it creates a thumbnail and keeps the original image. therefore the thumbnail gets shown and it is resized economically and is not merely squashed to fit. when the user clicks the enlarge image it shows the original. I will post the code for you tomorrow as I have to go right now so dont have time to dig it out. sorry...

Comment #6

Thankyou for your help Gareth.

Did you have any luck funding up your code?.

Does it resize the origional image if it is too big?.

Word of warning all, the forums are having problems sending emails of replys, so you will need to check withing your controll panel :-(.

Kind Regards All.

Dave..

Comment #7

Lol sorry I totally forgot!!.

Useless I know.

Here is the function we use.

Not sure how you would go about implementing it into the oscommerce admin because we create our own 'oscommerce' admin which is where the products etc get uploaded for us. This helps us make modifications more easily and cuts out access to alot of the stuff which we don't want clients messing with..

The way it works is -.

Upload image before calling function..

Then call function.

This creates thumbnail.

Then thats it really.

Just modify pages where thumbnail is showed to enable them to show the thumbnail instead of the big image shrunken down. the name of the thumbnail is the same as the big image but with '_thumb' on the end. you change the display code (to display the thumbnail) by exploding it to split the file ending and the name-then add _thumb onto the end of the name (name in database). hope you understand.

But I hope it is useful to you..

<?php.

/*.

$original     = Full path to the source image.

$target       = Full path to target image file (not just thumb extension-must be full name).

$width        = Target maximum width.

$height       = Target maximum height.

$type         = Target file type. 1->GIF, 2->JPEG, 3->PNG.

$proportioned = If true then original proportions retained,.

   (hence 'max' width and height). If.

   false then resize to absolute width.

   and height)..

$quality      = Target image quality, only used for JPEG..

*/.

Function ResizeImage($original, $target, $width, $height, $type, $proportioned=true, $quality=30).

{.

$img_dims = getimagesize($original);.

If($img_dims[2]>=1 && $img_dims[2]<=3 && ($type==2 || $type==3)).

{.

 $ImageWrite="";.

 switch ($img_dims[2]).

 {.

 case 1:.

   $img=ImageCreateFromGif($original);.

 break;.

 case 2:.

   $img=ImageCreateFromJpeg($original);.

 break;.

 case 3:.

   $img=ImageCreateFromPng($original);.

 break;.

 }.

 .

 if($proportioned).

 {.

 if(($img_dims[0]/$img_dims[1])>($width/$height)).

 {.

   $height=($img_dims[1]/$img_dims[0])*$width;.

 }.

 else if(($img_dims[0]/$img_dims[1])<($width/$height)).

 {.

   $width=($img_dims[0]/$img_dims[1])*$height;.

 }.

 }.

 $img_tmp=imagecreatetruecolor($width, $height);.

 if($img_tmp).

 {.

 if(imagecopyresampled($img_tmp,.

       $img,.

       0, 0, //dest coord.

       0, 0, //source coord.

       $width, $height, //dest sizes.

       $img_dims[0], $img_dims[1] // src sizes.

     )).

 {.

   switch ($type).

   {.

   case 2:.

     $ImageWrite="ImageJpeg";.

   break;.

   case 3:.

     $ImageWrite="ImagePng";.

   break;.

   }.

   .

   if($ImageWrite($img_tmp, $target, $quality)).

   {.

   return 1;.

   }.

   else.

   {.

   //failed to resample image.

   return 0;.

   }.

 }.

 else.

 {.

   //failed to copy image.

   return 0;.

 }.

 }.

 else.

 {.

 //failed to create temporary file.

 return 0;.

 }.

}.

Else.

{.

 //unsupported file type.

 return 0;.

}.

Return 0;.

} .

?>..

Comment #8

Thanks Gareth.

It looks complicated to install, so I think I will have to leave it untill I get back from holiday in 2 weeks..

Speak to you all soon.

Kind Regards.

Dave..

Comment #9

Hi Gareth,.

Many thanks for posting that code, I had no idea actually that there _were_ any PHP functions to work with images (dumb, aren't I !!! )..

Looking through php.net after seeing the functions you used, and I came across an online overview of image functions, wow, incredible stuff. Here's the post from php.net.

Peter..

Comment #10

If I upload an image that is 1280 x 960 (1.3 Mp) OSCommerce will resize the picture smaller for the thumbnails, But is there a way to make OSCommerce resize the image "on the fly" to 640 x 480 if someone clicks on the "click to enlarge" link???.

I have seen some contributions that will allow you to upload 3 diffrent sized images, but this is obversally hard work when there might be a script that will do it automatically for you..

Many Thanks.

Dave..

Comment #11

Hi,.

Have a look at my post in this topic:.

Http://forums.oscomm...showtopic=92548.

It is more related to a popup without an image (just html text), but I _think_ if the popup window dimensions reflected the 640 x 480 size, it _might_ just work ??.

Peter..

Comment #12


This question was taken from a support group/message board and re-posted here so others can learn from it.