CalendR - php библиотека календаря
Пример создания календаря
getMonth(2012, 01);
?>
http://yohan.giarel.li/CalendR/
getMonth(2012, 01);
?>
getAuthentication('optional_passphrase', 'optional_username');
echo $exec->run('ls -lah');
align = 'left';
$text1->color = 'FFFFFF';
$text1->font = dirname(__FILE__) . '/Ubuntu-Medium.ttf';
$text1->lineHeight = 36;
$text1->size = 24;
$text1->startX = 40;
$text1->startY = 40;
$image->addText($text1);
// Add another styled text to image
$text2 = new \NMC\ImageWithText\Text('No, really, thanks!', 1, 30);
$text2->align = 'left';
$text2->color = '000000';
$text2->font = dirname(__FILE__) . '/Ubuntu-Medium.ttf';
$text2->lineHeight = 20;
$text2->size = 14;
$text2->startX = 40;
$text2->startY = 140;
$image->addText($text2);
// Render image
$image->render(dirname(__FILE__) . '/destination.jpg');
$factory = new \ImageOptimizer\OptimizerFactory();
$optimizer = $factory->get();
$filepath = /* path to image */;
$optimizer->optimize($filepath);
//optimized file overwrites original one
// Create an array containing file paths, resource var (initialized with imagecreatefromXXX),
// image URLs or even binary code from image files.
// All sorted in order to appear.
$frames = array(
imagecreatefrompng("/../images/pic1.png"), // Resource var
"/../images/pic2.png", // Image file path
file_get_contents("/../images/pic3.jpg"), // Binary source code
'http://thisisafakedomain.com/images/pic4.jpg', // URL
);
// Create an array containing the duration (in millisecond) of each frames (in order too)
$durations = array(40, 80, 40, 20);
// Initialize and create the GIF !
$gc = new GifCreator();
$gc->create($frames, $durations, 5);
Поличить результат
$gifBinary = $gc->getGif();
$ffmpeg = FFMpeg\FFMpeg::create();
$video = $ffmpeg->open('video.mpg');
$video
->filters()
->resize(new FFMpeg\Coordinate\Dimension(320, 240))
->synchronize();
$video
->frame(FFMpeg\Coordinate\TimeCode::fromSeconds(10))
->save('frame.jpg');
$video
->save(new FFMpeg\Format\Video\X264(), 'export-x264.mp4')
->save(new FFMpeg\Format\Video\WMV(), 'export-wmv.wmv')
->save(new FFMpeg\Format\Video\WebM(), 'export-webm.webm');