Jump to content

Cut pixels of picture without having to save the cropped file


Silvar

Recommended Posts

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.

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.