- Posts: 640
- Thank you received: 16
Help handling image sizes for category thumbnails
- PeterChain
-
Topic Author
- Offline
Less
More
11 years 4 days ago #216126
by PeterChain
Help handling image sizes for category thumbnails was created by PeterChain
-- HikaShop version -- : 2.6.5
-- Joomla version -- : 3.4.3
I have this code extracted from a default view that loads an image for each catefory thumbnail
I want to make my view load the images with the double the resolution it as actually creating the thumbs (because of a nice animation effect I created).
Or if calculation is not possible how can I force a loading at a predefined px width and height?
Thank you.
-- Joomla version -- : 3.4.3
I have this code extracted from a default view that loads an image for each catefory thumbnail
Code:
<div class="hikashop_category_image"> <!-- height:<?php echo $this->image->main_thumbnail_y; ?>px;text-align:center;clear:both; -->
<a href="<?php echo $link; ?>" title="<?php echo $this->escape($this->row->category_name); ?>">
<?php
$image_options = array('default' => true, 'forcesize' => $this->config->get('image_force_size', true), 'scale' => $this->config->get('image_scale_mode', 'inside'));
$img = $this->image->getThumbnail(@$this->row->file_path, array('width' => $this->image->main_thumbnail_x, 'height' => $this->image->main_thumbnail_y), $image_options);
if ($img->success) {
echo '<img class="hikashop_product_listing_image" title="' . $this->escape(@$this->row->file_description) . '" src="' . $img->url . '"/>';
}
?>
</a>
</div>
I want to make my view load the images with the double the resolution it as actually creating the thumbs (because of a nice animation effect I created).
Or if calculation is not possible how can I force a loading at a predefined px width and height?
Thank you.
Please Log in or Create an account to join the conversation.
11 years 3 days ago #216133
by nicolas
Replied by nicolas on topic Help handling image sizes for category thumbnails
Hi,
It sure is possible.
Just change the line:
There you have $this->image->main_thumbnail_x that you can replace by the value in px of the width you want, and $this->image->main_thumbnail_y that you can replace by the height.
It sure is possible.
Just change the line:
Code:
$img = $this->image->getThumbnail(@$this->row->file_path, array('width' => $this->image->main_thumbnail_x, 'height' => $this->image->main_thumbnail_y), $image_options);
Please Log in or Create an account to join the conversation.
Time to create page: 0.160 seconds