- Posts: 3
- Thank you received: 0
When uploading a product picture, color problem
-- HikaShop version -- : HikaShop Business 2.3.2
-- Joomla version -- : Joomla 3.3.3
-- Browser(s) name and version -- : Chrome
Hello,
when i upload a picture for the product page and hikashop resize it, it fills the picture with a white "background" color.
Then the former picture becomes bigger but it is surrounded by white color.
i would like to set Hikashop, if possible, to color the contour of the resized picture in blue in stead of white.
Could you tell me if that is possible?
Thank you for your help,
Meligrafi
Please Log in or Create an account to join the conversation.
What kind of picture are you uploading ? PNG ? GIF ?
HikaShop should resize the image and keep the transparency of the image, depending how the image has been encoded, it is possible that the PHP GD library can't handle correctly the alpha channel.
Knowing more about the image could help us (and you) to understand the problem.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
I am uploading JPG so no alpha channel. It seems that the script is creating a white background by default when resizing the pictures. So my question is: would it be possible to change it to a blue background? ...so i can still use the automatique resize script when uploading pictures.
Thanks for your help.
Please Log in or Create an account to join the conversation.
Ok I see, you're using the "force size" option.
It is possible to change the background color in the parameters for the function getThumbnail of the HikaShop image helper.
In the file "administrator/components/com_hikashop/helpers/image.php" you will find the line
The variable "$options" is a parameter of the function, so in your views you can set the background color without having to edit the HikaShop core file (the image helper).
More about display customization:
www.hikashop.com/support/support/documen...ize-the-display.html
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Regards.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Unfortunately, you'll have to do that change for each view file where the thumbnail is displayed.
So it could lead to a lot of changes: the product listings, the product page, the emails, the cart module, the cart view in the checkout, the cart details page, without even talking about the backend.
And each time the modification will be a bit different as the variable names are not necessarily the same.
To know which view file you want to change, you can activate the "Display view files" setting of the HikaShop configuration. That way, you'll be able to easily see which view file is used where (as it also depends on how your shop is configured I can't say for sure).
Then, you can edit them via the menu Display>Views.
I'll give you an example with the main image on the product details page. It's displayed with the code:
So it would look like that:
Please Log in or Create an account to join the conversation.
Isn't there an easier way to make the scaled images fit for a dark background? I suppose there are more sites that use a different background color than white on their site.
Regards,
Rachel
Please Log in or Create an account to join the conversation.
This was the info I was missing. It is working as I want it to now!
Regards Rachel
Please Log in or Create an account to join the conversation.
Having a transparent background is not an issue in most cases. HikaShop will keep the transparent background as long as the ratio of the image doesn't change.
So if you have the "force size" setting turned off, or if you have the "Image scale mode" setting set to "crop" of if you upload images with the same ratio that you configured in the thumbnails size settings, it won't have to add stripes around the tthumbnails and thus the color of the stripes won't matter as their won't be any.
Now that could still be an interesting setting to be able to define the stripes color. We'll think about that for a future improvement.
Please Log in or Create an account to join the conversation.
I see what you mean. There are often cases that you don't want to crop the tumbnails. So in my opinion it would be a great asset to have a background-color setting in de configuration.
Please Log in or Create an account to join the conversation.
I can't find the view that I need to edit to set the background color for the images shown in the cart and checkout. When I try to look with the setting "Display view files' enabled, the image doesn't get a view assigned.
Where can I set the background color for those thumbnails?
With kind regards,
Rachel Walraven
Please Log in or Create an account to join the conversation.
Note that there is now a setting "Stripes color" in the HikaShop configuration to define the background color of thumbnails.
So you should not need to edit view files anymore.
And regarding the cart / checkout, while there is no view file which displays just the image, there is a view which displays the whole cart. It is displayed around the cart when you have the "Display view files" option enabled, and that's the view you would want to edit.
For example, for the cart on the checkout, it's the file "show_block_cart".
In there, you can find that code which displays the product thumbnails:
Please Log in or Create an account to join the conversation.
Thank you Nicolas
With kind regards,
Rachel Walraven
Please Log in or Create an account to join the conversation.