Derfder Derfder - 5 months ago 42
PHP Question

Removing black borders 4:3 on youtube thumbnails

E.g. I have a link

http://img.youtube.com/vi/aOPGepdbfpo/0.jpg


for a youtube video thumbnail:

enter image description here

And I would like to remove the black top and bottom border so I get a picture like this:

enter image description here

Could it be done using PHP function javascript/jQuery or maybe youtube api itself?

Answer

Use it as a background image, center it and change height.

http://dabblet.com/gist/4012604

.youtubePreview {
    background:url('http://img.youtube.com/vi/aOPGepdbfpo/0.jpg') center no-repeat;
    height:204px;
    width:480px;
}
Comments