Silvar Posted January 26, 2013 Share Posted January 26, 2013 I've put this into the PHP section as I might think that PHP has to be used in this situation. Don't know if it's possible with CSS. I got these pictures on my site from my latest YouTube uploads. These god damn pictures included in the xml file my script is linked to, got stupid black frames in top and bottom, even though the scaling of the picture is what it has to be. It's just a stupid thing from youtube i reckon. But I want to cut these black frames away from the top and the bottom of the picture. The picture is set as a background image right now, as I tried to fix the background with minus properties in background-position, but didn't work. Do I have to use PHP for this or is there any way of doing this in CSS? I've searched around for solutions and it can't be true that I have to get the file, cut pixels and then save it on my own domain to get the black boxes cropped of. My logical sense tells me that there has to be easier solutions not to show these pixels form the thumbnail. Thank you in advance. Quote Link to comment https://forums.phpfreaks.com/topic/273671-cut-pixels-of-picture-without-having-to-save-the-cropped-file/ Share on other sites More sharing options...
White_Lily Posted January 26, 2013 Share Posted January 26, 2013 (edited) you could make the box the background image sits in the same size as the image you want to show, then say: #box id/class { background: url("../filepath/filename") center no-repeat; } Edited January 26, 2013 by White_Lily Quote Link to comment https://forums.phpfreaks.com/topic/273671-cut-pixels-of-picture-without-having-to-save-the-cropped-file/#findComment-1408393 Share on other sites More sharing options...
Silvar Posted January 26, 2013 Author Share Posted January 26, 2013 you could make the box the background image sits in the same size as the image you want to show, then say: #box id/class { background: url("../filepath/filename") center no-repeat; } This is one of the moments where I'm thinking: "Ofcourse, that's obvious". I put position: relative; to the image inside the div and made a top: -10px. Thanks for guiding me into using my own brain Quote Link to comment https://forums.phpfreaks.com/topic/273671-cut-pixels-of-picture-without-having-to-save-the-cropped-file/#findComment-1408418 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.