Magento. Experienced. | by sneako

Feb/10

17

Tall Images Get Cut Off Within Product Info Screen

When you are viewing your product information screen you may notice that when the product has a tall picture (such as oil & vinegar bottles) only the top of the image is displayed within the picture window (the one right above “Double click on above image to view full picture”).  This small change will allow the images to be re-sized to fit this screen.No matter what you do to try and re-size the image it keeps on showing only the top of it!  Even if you shrink it down to 1×50 it’ll still only display the top bit causing a very ugly, pixelated mess.

—————————————————
A) Open for editing:

-  app/design/frontend/***your_theme_here***/template/catalog/product/view/media.phtml

—————————————————

B) Change (line 41 for me):

$_img = '<img id="image" src="'.$this->helper('catalog/image')->init($_product, 'image')->.'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" />';

—————————————————

C) To:

$_img = '<img id="image" src="'.$this->helper('catalog/image')->init($_product, 'image')->resize(795).'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" />';

—————————————————

Depending on the zoom depth (via the – & +) you wish to have you can edit the “795” to be higher or lower (I did multiples of 265 cause it messed up on other multiples for some odd reason).  Raise the number (ie: 1325) to make the zoom ability much greater or lower it (ie: 265) to make the zoom ability barely anything.

—————————————————

I’m not sure how “resize” knows what size to make the image, I assume it’s a clause somewhere in the code but all I know is that it worked for me :D

RSS Feed

No comments yet.

Leave a comment!

<<

>>

Find it!

Theme Design by devolux.org