The Official Website of AgoraCart and Agora.cgi
AgoraCart.com Demos Download AgoraCart User Manuals & Wiki Gold Members Forum Go Gold Now! Gold Version Memberships

AgoraCart.com

About
Features
Download
Payment Gateways
Send a Donation
Founders Club
BLOG: News & Updates

Showcases & Demos

AgoraCart Demos
Shop Live Stores

Downloads & Add-ons

Gold Version Downloads
DBwizz Database Mgr.
AgoraCart.com Store

Help & Support

User Manuals
Gold Version Users Forum
Gold Version Chat
Tech Support
Certified Agora Pros
Certified Designers
Hire a Freelancer

Gold Version Members

Member Benefits
Join Today!
Gold Members Home
Gold Version Users Forum
Gold Version Chat Rooms
Gold Version Downloads

For Store Owners

Merchant Accounts
Cool Resources
Advertise Here
"Powered by" Logos
Web Hosting Search

Misc.

Contact Us
MEET's Talking Guide
The Ancient Greek Agora






AgoraCart Free User Forums

This is the official FAQ and Cool Tips guide For the AgoraCart shopping Cart software


Official Sponsors of the AgoraCart Project:

       


RegisterSearchFAQLog in
Reply to topic Page 1 of 1
How to change the size of image ?
Author Message
Reply with quote
Post How to change the size of image ? 
Hi.
I have a problem. In my AgoraCart's database I have the product images but almost all of them have diffrent size and it looks bad when you are surfing through the shop. I need to do something that my Agora Shop will show them in the same size (not only in a particular product view but also in cart view).
I tried put static size for products in "productPage.inc" file (for example 200x200 pixels)but:
1. it doesn't work with the cart view and
2. when a image has size 100x200 and I will show it in 200x200 It's look bad!
Maybe I need same script. But what and where locate it?

View user's profile Send private message
Reply with quote
Post  
What you need to do is resize your images to the appropriate size. IF you want to have a thumbnail image you will need to create those and use the user1/2nd image field in the database to do that.

The best way to do that is to set just images to the same width.
There are batch resizers available, I use Express Thumbnail Creator.

HTH!


_________________
God Bless!
Bonnie - AgoraCart Moderator

Get a Gold Membership
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger ICQ Number
Reply with quote
Post  
hell-o
don't ever resize up unless you want bad product images which is not a good thing.
find the image with the largest height and width. then go to your handy dandy image editor and either make a colored background plan image or a transparent image the smae height and width of your largest product image. use that blank as a template then one by one insert the smaller images into the blank, centered. when you save, "save as" the name of the product image so you don't have to make any changes there and you don't overwrite your template.

i have been in contact with the owner of a popular resizing program to automate this exact issue. maybe time to see if any progress has been made on this issue.
something easier just came to mind... Wink
make a transparent image the width of the largest image you have. for example if your largest image is 200px wide make the transparent image 200x1. place it in your public_html/images folder. call it "wide.gif" or something similar.
in your ppinc, in the iimage table cell <td> do something like this...
Code:
<td valign=middle align=center width="201" height="201">
       <img src="PATH TO IMAGE/wide.gif" border=0> <br>
       %%image%%</td>


you may want to change the alignment attributes to suit your needs if center and middle look bad.
notice i added 1 px to the width and the height. you can do the same thing to the height to keep things from speading out vertically too.

for the height problem you can do this...
Code:
<td valign=middle align=center width="201" height="201">
       <img src="PATH TO IMAGE/wide.gif" border=0> <br>
       <img src="PATH TO IMAGE/height.gif" border=0>%%image%%</td>

make the height.gif 200px high and 1 px wide and transparent.

once you get the images standard in sixe you may find some descriptions are kinda hangin out there but that is another issue of placement of ppinc componants.
regards,
dan

Reply with quote
Post  
Thanks for fast answer.
Actually I do not care of the quality of a picture.
I want make easy adding product to the shop for my customer, for whom I make this shop. I want that he doesn't have to care of the size of image. He should just put any picture of a product to the AgoraCart's database and all of those pictures will be showed by Agora in the same sizes(I mean that just the height of all images must be the same, width must be in proportion to the original image)
I do not want to change the size of images which are stored by Agora!
I just need some script or something like this that it will take a image from database and will
show it on web site in different size.

I found some PHP script, but I don't know where to put it?
Code:
<?
function image_resize($image_file, $width, $height, $download)
         {
         $src = "jpg-resize.php?" .
                "image_file=" . urlencode($image_file) . "&" .
                "width=" . $width . "&" .
                "height=" . $height;
         
         $img = "<img " .
                "border=\"0\" " .
                "width=\"" . $width . "\" " .
                "height=\"" . $height . "\" " .
                "src=\"" . $src . "\" />";
               
         if($download == true)
            $img = "<a href=\"" . $image_file . "\">\n" .
                   $img . "</a>";
               
         echo($img);
         }
         
function image_horizontal_resize($image_file, $width, $download)
         {
         $original_size = getImageSize($image_file);
         $original_width = $original_size[0];
         $original_height = $original_size[1];
         
         $height = round($original_height * ($width / $original_width));
         
         image_resize($image_file, $width, $height, $download);
         }
         
function image_vertical_resize($image_file, $height, $download)
         {
         $original_size = getImageSize($image_file);
         $original_width = $original_size[0];
         $original_height = $original_size[1];
         
         $width = round($original_width * ($height / $original_height));
         
         image_resize($image_file, $width, $height, $download);
         }
       
if(isset($_GET))
  {
  header("Content-type: image/jpeg");
     
  $image_file = $HTTP_GET_VARS["image_file"];
  $width = $HTTP_GET_VARS["width"];
  $height = $HTTP_GET_VARS["height"]; 
       
  $original_size = getimagesize($image_file);
  $original_width = $original_size[0];
  $original_height = $original_size[1];
 
  $original_jpg = imageCreateFromJPEG($image_file);
  $resized_jpg = imageCreateTrueColor($width, $height);
 
  imageCopyResized($resized_jpg, $original_jpg, 0, 0, 0, 0,
                   $width, $height, $original_width, $original_height);
 
  imageJPEG($resized_jpg);
  imageDestroy($resized_jpg);
  }     
?>

Do you think I am on good way?

View user's profile Send private message
Reply with quote
Post  
You cannot use php with cgi, they don't "play" well together.
One should be concerned with the quality of an image, especially the shop owner.
Better images equal out to better sales.
Why is the height of the image more important?
Varying widths of images can throw off the horizontal layout of the web page.

There is a way to do it dynamically.... not the best thing to do, but....
1. In the free form logic, box 2, put:
(You can change the width tag to a height tag if that is the important dimension...)
Code:

$sc_image_string_template =  '<IMG SRC="%%URLofImages%%/%%image%%" BORDER=0 ALT="" width="100">';


Then to update all of the product's images in the database to reflect the changes,
go to the manager -> Database
Click on the "Update IMG Tags and PAD LENGTH" button.
This will also shorten or lengthen all of the product ID numbers to whatever is set as
the pad length in the manager -> Program Settings -> Main AgoraCart Store Settings.
It will also update the image calls in the store.

HTH!



Last edited by scottcrew on Thu Aug 11, 05 5:16 am; edited 1 time in total

_________________
God Bless!
Bonnie - AgoraCart Moderator

Get a Gold Membership
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger ICQ Number
Reply with quote
Post  
But I do not want to change the original files.
I want that the web site shows my images in the maximum size 200x200(can be smaller, but not bigger).
If a image is bigger than 200x200 the web site should show it smaller that it can be showed in a frame 200x200. If a image is smaller than 200x200 the web site should show it in the original size.
Something like this:
Code:
<TD ALIGN="CENTER" WIDTH="200" height="200">  %%image%% </TD>

(this is from productPage.inc) but it doesn't work exactly as I want. If a %%image%% is bigger than 200x200 AgoraCart does not make it smaller. It works good only for a picture with size less than 200x200.
On the other hand,I tried do:
Code:
<TD ALIGN="CENTER" > <IMG  height="200" %%image%% ></TD>

for a bigger image it works OK, but when a picture is smaller than 200x200 it doesn't.
Can you help me with this issue?

View user's profile Send private message
Reply with quote
Post  
hell-o
it is not reccomened that you do things this way. but since you insist you can try this...
store/library/agora.setup.db file.
around line 28 you will see something like this...
Code:
$sc_image_string_template =  '<IMG SRC="%%URLofImages%%/%%image%%" BORDER=0 >';

add your height and with here. be sure to check all images called through agoracart to besure it doesn't dusrupt something else.
regards,
dan

Reply with quote
Post  
I tried , it doesn't work. It did not do any changes in the product view Sad

View user's profile Send private message
Reply with quote
Post  
As I stated above, you have to have all of the products updated in the database. Just changing the line "$sc_image_string_template" will not change the display...

You need to:
scottcrew wrote:

Then to update all of the product's images in the database to reflect the changes,
go to the manager -> Database
Click on the "Update IMG Tags and PAD LENGTH" button.
This will also shorten or lengthen all of the product ID numbers to whatever is set as
the pad length in the manager -> Program Settings -> Main AgoraCart Store Settings.
It will also update the image calls in the store.


HTH!


_________________
God Bless!
Bonnie - AgoraCart Moderator

Get a Gold Membership
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger ICQ Number
Reply with quote
Post  
It steel doesn't work.
Anyway, Thanks for your efforts.

View user's profile Send private message
Reply with quote
Post  
It does work, I have tested this and it had worked.
What is the URL to your store?
What exactly have you done to make this work?


_________________
God Bless!
Bonnie - AgoraCart Moderator

Get a Gold Membership
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger ICQ Number
Reply with quote
Post  
http://www.asherm.com/shop/ then go to "Shop" and than to T-Shirts.
Right now, after this changes Agora shows me notavaible.gif
What I did:
1. In the library/agora.setup.db I changed line:
$sc_image_string_template = '<IMG SRC="%%URLofImages%%/%%image%%" BORDER=0 ALT="" heigth="100">';
I added, as you told me, ALT="" heigth="100"
and after this I want to Manager->database->updateIMG...
So , now I have not images showed by Agora (the two first product group:Music and Reggaeton I changed manually)

View user's profile Send private message
Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum