Post by ervinsc » Tue Aug 31, 2021 5:11 am

Maybe somebody can help with this.
Any options to avoid this white frame/background around the image.
I understand, I can put dimensions in the theme settings, but it is not solution as the images are slighty diference in aspect ratio. Any auto option for this?


Image Image Image

Newbie

Posts

Joined
Thu Aug 26, 2021 3:49 am

Post by by mona » Tue Aug 31, 2021 6:08 am

create images with transparent backgrounds and save as png
keep all images to 500x500 or whatever and set the image pop up size as 500x500 (the same)
this will fill the space and remove the white background.

The pop up creates a background shadow so you have to remove that also in your stylesheet

Code: Select all

 .mfp-figure::after {
        box-shadow: 0 0 8px rgba(0, 0, 0, 0.0);
       background:transparent;
    }
if that doesn’t work you might have to add important

Code: Select all

 .mfp-figure::after {
        box-shadow: 0 0 8px rgba(0, 0, 0, 0.0) !important;
       background:transparent !important;
    }

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by ervinsc » Tue Aug 31, 2021 6:24 am

Images are without any background originally... this white background is created by script...

Newbie

Posts

Joined
Thu Aug 26, 2021 3:49 am

Post by by mona » Tue Aug 31, 2021 6:54 am

ervinsc wrote:
Tue Aug 31, 2021 6:24 am
Images are without any background originally... this white background is created by script...
I am aware how how the white background is created.
The solution has been provided above.





Screen-Shot-2021-08-30-at-23.50.38.png

Screen-Shot-2021-08-30-at-23.50.38.png (239.96 KiB) Viewed 661 times

Screen-Shot-2021-08-30-at-23.52.18.png

Screen-Shot-2021-08-30-at-23.52.18.png (164.49 KiB) Viewed 661 times


DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by ervinsc » Tue Aug 31, 2021 7:34 am

Should I add in this stylesheet?
catalog/view/theme/yourtheme/stylesheet/stylesheet.css
Can you advice where exactly I should add this code?

Newbie

Posts

Joined
Thu Aug 26, 2021 3:49 am

Post by by mona » Tue Aug 31, 2021 8:01 am

I am not sure you understood what it is you have to do.

1. You have to save all your images as png images all of the same size. For example
one image today is 500x1000
another image is 1000x500
another image is 800x250

They are all saved as 1000x1000 - as png images - with transparent backgrounds.
You then go into your image sizes and set the image size of the pop-up as 1000x1000 (or 500x500, but it MUST me the same aspect ratio as the png image size)

(Clearly if you use the same name and same size as previously you will need to delete the cache image folder - because “IT” doesn’t know that you uploaded new images if the image name and size is the same - New image sizes will only be created if you make it 999x999 or 499x499 etc (or 500x500 if you have not already created those). <== IS THIS WHAT YOU ARE MISSING ???


2. You can add the css code anywhere in the theme stylesheet (as you stated above) - at the end is always best under a heading and then you just always add there
/* MY CUSTOM CODE */
- The important is probably required (as above)
(disclaimer: you should ideally create a custom stylesheet)

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by ervinsc » Tue Aug 31, 2021 1:53 pm

Thank you!

Newbie

Posts

Joined
Thu Aug 26, 2021 3:49 am

Post by paulfeakins » Tue Aug 31, 2021 6:25 pm

ervinsc wrote:
Tue Aug 31, 2021 1:53 pm
Thank you!
If that fixes the problem, please add [SOLVED] to the start of the post title.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by by mona » Tue Aug 31, 2021 11:11 pm

ervinsc wrote:
Tue Aug 31, 2021 1:53 pm
Thank you!
You are welcome - thank you for coming back and showing appreciation

as stated above - it helps other users in the future if you add [SOLVED] to the titled when searching.

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am
Who is online

Users browsing this forum: ianhaney50 and 14 guests