I was searching the complete forum, was asking 2 times, but didn't get any help with this issue.
All thumbnails have a white border and i was working for days (not only hours) with the CSS, but wasn't able to get rid of this *grrr* white border.
So where in the world is it written, that the thumbails get the white border from?
I found out, if i upload a picture in exactly the size, i set in the settings, there is no white border.
But there MUST be another way, to get the order for the white border away.
So please, pretty pretty please, Daniel show up and tell me the secret.
Tell me (and many, many other users, who have asked before) how to get rid of this white border.
Thank you
Freya
Reason: Changed the title
This is, in my eyes, NOT a template question, cause if this would be to find in the CSS, i would already had found the white border.
I changed EVERY white color, except the text color, and the white border is STILL there.
Event though i pointed on, if i set the image size to 250 x 250 (e.g) and load up a picture in exactly the same this, there is no white border.
So it have to be found somewhere else in the script, but not in the template.
And i can't ask all the vendors to do all promotion pictures again in a smaller size.
So please, tell me where i can change it and i'm very satisfied.
i just wonder.
I posted a question, that have nothing to do with the template. And for sure, i was working damned long with the CSS, without being able to solve the problem.
I was searching the forum and found a lot people, who had exactly the same question, but never got any satisfying answer.
Now my post have been moved into the template-forum, and i would like to know why!
If the moderator is so sure about, that this have something to do with the template, so why didn't he answer the question after moving?
Or are the words "white border" reason enough to move a post?
Sorry, if i sound aggressive, but i'm more than disappointed.
Anyone, at least this/that person/s, who wrote the script, should know, how to solve the problem.
Where are they?
And can please one of them solve the problem?
I have also edited the title and the first line as it was unpolite and addressed to Daniel directly.
I've also merged your 2 topics as asking the same question twice is not necessery.
Moving a topic does not means it also got to have an answer.
Looking at other topics and your question in particolare it has all to do with the look of your shop, aka the cosmetic look and therefore I think it is better of in the Template section. If you feel differend that is OK by my.
Maybe the next time you put up a question it would come handy if you would let us know which version of OpenCart and if the default template is used or a modified one. This to be more specific for anyone here to help you solve the question.
This is a forum where people ask and answer questions on a free base. This means that questions can be left unaswered or the answer will come in a few days. Just be patient.
To me the "problem" lies in the fact that if your picture is smaller then the frame it is in it will create that white space. Therefore you need to:Freya wrote:I found out, if i upload a picture in exactly the size, i set in the settings, there is no white border.
But there MUST be another way, to get the order for the white border away.
1. Make sure the picture has the right size.
2. Make sure you devine a backround color for that frame in your css, because I think it is not there atm. and thus you will see the white color.
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
But sorry, my topic was everything, but not unpolite. I didn't used mean words, only my thought, that at least he should know. With this i said, that i'm the meaning, he have the best knowledge. THIS is unpolite?
Or did i see too much in him? Sorry, my fault.
Many people have asked this question before, not one got an satisfying answer. Strange, isn't it? Even though, they wrote, what version and template they used.
I even haven't resized the pictures and for me it's strange, very strange, when i load up picture with 800 x 600 px and there is still a white border around a 200 x 200 px image.
And the background is black, only few parts are red, that makes white borders?
Answer is not in need, cause in this case there is no answer!
Thanks at least for this wonderful shop, even though it seems, i have to live with this borders, this is the best shop i ever found.
Good luck for the future
OpenCart resizes your original image files to the sizes you specify in the settings in the administration. Your images are resized proportionally and centred within the size specified, the remaining background colour is the "white border" you are talking about.
The background colour for the resized image is set in the file "system/library/image.php" at line 75:
Code: Select all
$background = imagecolorallocate($this->image, 255, 255, 255);
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!

Thanks for the help and to lead me to the right place to change it.
I could have searched for years in the CSS, when it isn't to find there.
Btw. it feels good, not to stand there like an idiot, because others wanted to tell me, it's in the CSS, event though i couldn't find it there.
will this not instead create a black linefido-x wrote:This is not a "border", it is a background colour.
OpenCart resizes your original image files to the sizes you specify in the settings in the administration. Your images are resized proportionally and centred within the size specified, the remaining background colour is the "white border" you are talking about.
The background colour for the resized image is set in the file "system/library/image.php" at line 75:You can change the colour by changing the RGB values (eg., 255, 255, 255 is white, 0, 0, 0 is black).Code: Select all
$background = imagecolorallocate($this->image, 255, 255, 255);

Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
So what you are saying is that because black --> 0 --> no colours, changing 255 to 0 will make the white lines transparent?fido-x wrote:No. Black would be "0, 0, 0". In other words, no colour. White is a combination of ALL colours. Hence, turning all RGB values to their maximum will give you white.
Sorry I would test but no access to my FTP at this precise moment.
No. What I'm saying is, if you set all RGB values to their minimum (ie. "0") you will get black. This is NOT transparent.Glinja wrote:So what you are saying is that because black --> 0 --> no colours, changing 255 to 0 will make the white lines transparent?
Technically black and white (and all greys) are not colours, they are "shades".
If you want your image to have a transparent background when it is resized, you need to start with an image that has a transparent background to begin with. The transparency will be retained when the image is resized.
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
What you need to do is to make sure the aspect ratio is properly calculated for images that are to be resized. There's an aspect ratio calculator at http://andrew.hedges.name/experiments/aspect_ratio/
$scale_w = $width / $this->info['width'];
$scale_h = $height / $this->info['height'];
if ($scale_w == 1 && $scale_h == 1) {
return;
}
$new_width = (int)($this->info['width'] * $scale_w);
$new_height = (int)($this->info['height'] * $scale_h);
It was stated to look for this code and change the rgb values. I did that to just the one line but it did not work.
Code: Select all
$background = imagecolorallocate($this->image, 255, 255, 255);
Code: Select all
$background = imagecolorallocatealpha($this->image, 255, 255, 255, 127);
imagecolortransparent($this->image, $background);
} else {
$background = imagecolorallocate($this->image, 255, 255, 255);
}
All of my images were uploaded as .jpg. I did edit one to a .png and uploaded it and it did not show the white border. I realize this is a solution but I really do not want to have to edit sooo many images.
No. The first part (before the "} else {" deals with the tranparancy and sets white as the tranparent colour (applies to .gif and .png files). The bit after the "} else {", deals with the background colour for images without a transparency, eg., .jpg images.alaskaberries wrote:Do I need to change both instances where it shows 255,255,255? to a color such as my background rgb color?Code: Select all
$background = imagecolorallocatealpha($this->image, 255, 255, 255, 127); imagecolortransparent($this->image, $background); } else { $background = imagecolorallocate($this->image, 255, 255, 255); }
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
Yes it does!blackhalo wrote:Yes, I understand this... but it still doesn't work.fido-x wrote:Image sizes can be set under the store settings in the administration (under the "Image" tab). By default these are "square" (ie. an aspect ratio of 1:1). If all your images have, for example, a 4:3 aspect ratio , then all you have to do is reflect this ratio in the image dimensions you set in the admin. For example, change 120 x 120 to 120 x 90. No "core hacks" required.
Which side, top or bottom?blackhalo wrote:I have images with a 1px black border (ALL 4000 of my images)...
even when I use a ratio calculator, the images are still being stretched by one pixel.
It's quite obvious, because one side is always 2px thick...
while the other three sides are a clean 1px.
Either way, it's easy to fix. Just reduce the "height" by 1 pixel in the admin. Or, have a look in your stylesheet and get rid of any padding in the image class.
I have. It's the same method I use on my own site and I have NO problems.blackhalo wrote:Try it for yourself.
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
Users browsing this forum: No registered users and 5 guests