2017 © Pedro Peláez
 

library youtubethumb

A PHP class created to help you load, edit and save thumbnails from videos on Youtube.

image

jyggen/youtubethumb

A PHP class created to help you load, edit and save thumbnails from videos on Youtube.

  • Wednesday, February 27, 2013
  • by jyggen
  • Repository
  • 1 Watchers
  • 2 Stars
  • 25 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

YoutubeThumb Build Status

A PHP class created to help you load, edit and save thumbnails from videos on Youtube., (*1)

Find YoutubeThumb on Packagist/Composer, (*2)

Examples

use jyggen\Youtube\Thumbnail;

// Load a thumbnail and save it to disk.
Thumbnail::forge('83fJ7hlZkpA')->save('my_path/');

// Maybe we wanna do some changes aswell. Retrieve the previously forged instance.
$thumb = Thumbnail::instance('83fJ7hlZkpA');

// Get the Thumbnail's GD resource.
$data  = $thumb->getData();

// Create a new GD resource and copy a portion of the thumbnail into our new image.
$dest = imagecreatetruecolor(80, 40);
imagecopy($dest, $data, 0, 0, 20, 13, 80, 40);

// Set our old thumbnail to the new resized one.
$thumb->setData($dest);

// Oh shit, did we fudge up something? Reset the image to its original state.
$thumb->reset();

// We want to save the image again, but with a different name and extension.
$thumb->setName('my_awesome_thumbnail');
$thumb->save('my_path/', 'gif');

Thumbnail object

Static Methods

  • forge(string $youtubeId)
    Forge a new Thumbnail instance.
  • instance(string $youtubeId)
    Retrieve an existing Thumbnail instance.

Methods

  • reset()
    Reset the thumbnail to its original state.
  • save(string $path, string $extension = 'png')
    Save the thumbnail to disk.
  • getData()
    Get the thumbnail's GD resource.
  • setData(resource $data)
    Set the thumbnail's GD resource.
  • getName()
    Get the output name without extension.
  • setName(string $name)
    Set the output name without extension.

The Versions

27/02 2013

dev-master

9999999-dev https://github.com/jyggen/YoutubeThumb

A PHP class created to help you load, edit and save thumbnails from videos on Youtube.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

image thumbnail youtube

27/02 2013

v2.1

2.1.0.0 https://github.com/jyggen/YoutubeThumb

A PHP class created to help you load, edit and save thumbnails from videos on Youtube.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

image thumbnail youtube

30/11 2012

v2.0

2.0.0.0 https://github.com/jyggen/YoutubeThumb

A PHP class created to help you load, edit and save thumbnails from videos on Youtube.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

image thumbnail youtube

24/11 2012

v1.0

1.0.0.0 https://github.com/jyggen/YoutubeThumb

A PHP class created to help you load, edit and save thumbnails from videos on Youtube.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

image thumbnail youtube