[Skip to main content](#vessel-content)

#   Updated product image size shows old size

##

- **[simonkloostra](/forum/user/4870-simonkloostra "View simonkloostra's Profile")**
- [![simonkloostra's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4870-simonkloostra "View simonkloostra's Profile") Topic Author
- [ Offline](/forum/user/4870-simonkloostra)

Less More

- Posts: 137
- Thank you received: 4
-
-

1 year 11 months ago [\#364876](#364876) by [simonkloostra](/forum/user/4870-simonkloostra "View simonkloostra's Profile")  *[Updated product image size shows old size](/forum/26-product-category-display/908951-updated-product-image-size-shows-old-size#364876 "-- HikaShop version -- : 5.1.1 -- Joomla version -- : 5.2.2 -- PHP version -- : 8.2 -- Browser(s) name and version -- : All -- Error-message(debug-mod must be tuned on) -- : None  I am working on a dev site, trying to optimize my product images. They were set to display at 300px wide, but I changed that to 400px, see screenprint). However, upon accessing the page (also after a repeat visit), the initial image shows at 300 px still, though the div inside which is shown is at 400 x 400 now. Hovering over any other thumbnial (including the thumbnail for the inital image) does show the images at 400px.  I do not use caching, but just to be sure, I issued a clear cache inside Joomla and from the hosting panels.  Can you tell me how to fix this? Let me know if you need backend access.")* was created by *[simonkloostra](/forum/user/4870-simonkloostra "View simonkloostra's Profile")*

-- HikaShop version -- : 5.1.1
-- Joomla version -- : 5.2.2
-- PHP version -- : 8.2
-- Browser(s) name and version -- : All
-- Error-message(debug-mod must be tuned on) -- : None

I am working on a dev site, trying to optimize my product images. They were set to display at 300px wide, but I changed that to 400px, see screenprint). However, upon accessing the page (also after a repeat visit), the initial image shows at 300 px still, though the div inside which is shown is at 400 x 400 now. Hovering over any other thumbnial (including the thumbnail for the inital image) does show the images at 400px.

I do not use caching, but just to be sure, I issued a clear cache inside Joomla and from the hosting panels.

Can you tell me how to fix this? Let me know if you need backend access.

[ ![hikashop-images.gif](/forum/attachment/60071) ](/forum/attachment/60071 "...hop-images.gif")

[ ![config.jpg](/forum/attachment/60072) ](/forum/attachment/60072 "config.jpg")

- [ ![hikashop-images.gif](/forum/attachment/60071) ](/forum/attachment/60071 "...hop-images.gif") [ ](/forum/attachment/60071?download=1 "...hop-images.gif")
- [ ![config.jpg](/forum/attachment/60072) ](/forum/attachment/60072 "config.jpg") [ ](/forum/attachment/60072?download=1 "config.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDg5NTEtdXBkYXRlZC1wcm9kdWN0LWltYWdlLXNpemUtc2hvd3Mtb2xkLXNpemU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86584
- Thank you received: 14325
-
-

1 year 11 months ago -  1 year 11 months ago [\#364877](#364877) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Updated product image size shows old size](/forum/26-product-category-display/908951-updated-product-image-size-shows-old-size#364877 "-- HikaShop version -- : 5.1.1 -- Joomla version -- : 5.2.2 -- PHP version -- : 8.2 -- Browser(s) name and version -- : All -- Error-message(debug-mod must be tuned on) -- : None  I am working on a dev site, trying to optimize my product images. They were set to display at 300px wide, but I changed that to 400px, see screenprint). However, upon accessing the page (also after a repeat visit), the initial image shows at 300 px still, though the div inside which is shown is at 400 x 400 now. Hovering over any other thumbnial (including the thumbnail for the inital image) does show the images at 400px.  I do not use caching, but just to be sure, I issued a clear cache inside Joomla and from the hosting panels.  Can you tell me how to fix this? Let me know if you need backend access.")*

Hi,

If I check the HTML of your page I see this:
[ i.imgur.com/01ykJwI.png](https://i.imgur.com/01ykJwI.png)
The img tag of the main image has a width and a height attributes with a value of 300.

This is done by the code: Code:

$attributes = 'style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle"'; if($img-&gt;external &amp;&amp; $img-&gt;req_width &amp;&amp; $img-&gt;req_height) $attributes .= ' width="'.$img-&gt;req_width.'" height="'.$img-&gt;req_height.'"'; $html = '&lt;img id="hikashop_main_image'.$variant_name.'" '.$attributes.' title="'.$this-&gt;escape((string)@$image-&gt;file_description).'" alt="'.$this-&gt;escape((string)@$image-&gt;file_name).'" src="'.$img-&gt;url.'"/&gt;';

in the view file product / show_block_img.
So, if you look at the if in this code, the width and height attributes are actually only added if the image is an external image (meaning that the image is not on your website and the src attribute contains the full URL of the image).
The image on your page is a local file, so this $img-&gt;external variable should be set to false, and thus the width and height attributes should not be added to the img tag.
On top of this, the $img-&gt;req_width and $img-&gt;req_height should normally be the same as the thumbnail folder path as the code generating the thumbnail bases itself on the same values.

So, in short, I'm surprised you're able to get the result you see on your page. There are at least 2 things which makes this normally not possible. Also, I'm not able to reproduce the issue on my end. So, I'm thinking that you might have a view override of that view file with a different code.
Check if you have the file templates/YOUR_TEMPLATE/html/com_hikashop/product/show_block_img.php via FTP. If you have it, rename it to something else in order to deactivate the view override. Hopefully, it will fix the problem, confirming that the problem comes from some custom code.

If all this doesn't help, we'll need a backend access in order to check the situation more in depth.

Last edit: 1 year 11 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDg5NTEtdXBkYXRlZC1wcm9kdWN0LWltYWdlLXNpemUtc2hvd3Mtb2xkLXNpemU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[simonkloostra](/forum/user/4870-simonkloostra "View simonkloostra's Profile")**
- [![simonkloostra's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4870-simonkloostra "View simonkloostra's Profile") Topic Author
- [ Offline](/forum/user/4870-simonkloostra)

Less More

- Posts: 137
- Thank you received: 4
-
-

1 year 11 months ago [\#364884](#364884) by [simonkloostra](/forum/user/4870-simonkloostra "View simonkloostra's Profile")  Replied by *[simonkloostra](/forum/user/4870-simonkloostra "View simonkloostra's Profile")* on topic *[Updated product image size shows old size](/forum/26-product-category-display/908951-updated-product-image-size-shows-old-size#364884 "-- HikaShop version -- : 5.1.1 -- Joomla version -- : 5.2.2 -- PHP version -- : 8.2 -- Browser(s) name and version -- : All -- Error-message(debug-mod must be tuned on) -- : None  I am working on a dev site, trying to optimize my product images. They were set to display at 300px wide, but I changed that to 400px, see screenprint). However, upon accessing the page (also after a repeat visit), the initial image shows at 300 px still, though the div inside which is shown is at 400 x 400 now. Hovering over any other thumbnial (including the thumbnail for the inital image) does show the images at 400px.  I do not use caching, but just to be sure, I issued a clear cache inside Joomla and from the hosting panels.  Can you tell me how to fix this? Let me know if you need backend access.")*

Hi Nicolas, I had neither template override, but your analysis pointed me in the right direction. Indeed one of my optimization plugins enforced the 300 x 300 dimension. Disabling it solved my issue.

Many thanks for your swift response!

The following user(s) said Thank You: [nicolas](/forum/user/63-nicolas "View nicolas's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDg5NTEtdXBkYXRlZC1wcm9kdWN0LWltYWdlLXNpemUtc2hvd3Mtb2xkLXNpemU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.051 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
