making the product images (portrait ones) background clear.
I have a personal photography print shop and I have pictures in both Landscape (more wide than tall) and Portrait (Taller than wide).
The Landscape ones are fine but the portrait ones have white on each side of the picture.
Is there any code I can insert (say css/default or some place?) that can make the background of the image transparent?
Any and all help is appreciated. I don't konw much about coding but I'm learning so much just in the little under a week I've been in this community.
Maybe somewhere in here? Again, I have no idea this is just guessing. I thought I better ask the experts before I start meddling and breakdown my store.
*Start*
220> .products, .images, .categories {
float: left;
width: 33.3%;
text-align: center;
cursor: pointer;
font-size: 10px;
height: 140px;
}
.categories a {
text-decoration: none;
}
.images a {
font-size: 10px;
}
.images img, .categories img {
border: 0px;
margin-bottom: 10px;
}
242 .results {
*end*
Thanks again,
Scubi
I have a personal photography print shop and I have pictures in both Landscape (more wide than tall) and Portrait (Taller than wide).
The Landscape ones are fine but the portrait ones have white on each side of the picture.
Is there any code I can insert (say css/default or some place?) that can make the background of the image transparent?
Any and all help is appreciated. I don't konw much about coding but I'm learning so much just in the little under a week I've been in this community.
Maybe somewhere in here? Again, I have no idea this is just guessing. I thought I better ask the experts before I start meddling and breakdown my store.
*Start*
220> .products, .images, .categories {
float: left;
width: 33.3%;
text-align: center;
cursor: pointer;
font-size: 10px;
height: 140px;
}
.categories a {
text-decoration: none;
}
.images a {
font-size: 10px;
}
.images img, .categories img {
border: 0px;
margin-bottom: 10px;
}
242 .results {
*end*
Thanks again,
Scubi
You need to add this --> http://us3.php.net/imagesavealpha to your php.ini file or somewhere else. I don't have any experience with GD but others here do.
-JO
-JO
Last edited by JohnnyO on Mon Aug 04, 2008 11:39 pm, edited 1 time in total.
If you make it idiot proof, they will just build a better idiot.
it is actually setup that way in code...
in the library/images/image.php file line53 $background = imagecolorallocate($destination, 255, 255, 255);
http://www.experts-exchange.com/Web_Dev ... 49792.html
post an example of keeping the alpha of the image... sorry i don;t have time to see if this can be worked in or not..
also on this note... all images that are resized.... are saved/cached as a jpeg not as there orginal type... this controller may need to be expanded to handle this operation
ex original file type gif -> resized = jpg
Jonathon
in the library/images/image.php file line53 $background = imagecolorallocate($destination, 255, 255, 255);
http://www.experts-exchange.com/Web_Dev ... 49792.html
post an example of keeping the alpha of the image... sorry i don;t have time to see if this can be worked in or not..
also on this note... all images that are resized.... are saved/cached as a jpeg not as there orginal type... this controller may need to be expanded to handle this operation
ex original file type gif -> resized = jpg
Jonathon
Last edited by Luvz2drv on Tue Aug 05, 2008 6:31 am, edited 1 time in total.
How do you stop OpenCart from resizing the images?bruce wrote: The white background is created in the actual image when it is resized by opencart. Even files with transparent backgrounds will end up with white.
Image resizing is done by the relevant controller using the width and height values set in the administration.
If you wish to change the size of thumbnail images, go to Admin->Configuration->Setting->Image. You can also turn image resizing off if you wish, by setting "Resize Images" to "No" on this page.
Regards, Fido-X.
If you wish to change the size of thumbnail images, go to Admin->Configuration->Setting->Image. You can also turn image resizing off if you wish, by setting "Resize Images" to "No" on this page.
Regards, Fido-X.
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!
Who is online
Users browsing this forum: No registered users and 1 guest