This library was built to generate a series of Boomerang's from a given array of base64 images. This service handles saving the images, manipulating the images and returning a gif with the boomerang. Inspired by Instagram and their 10 photo boomerang's along with phhhoto 's experimental camera platform. This library aims to provide funfun stories for the Glimps photobooth platform and run along the tiler service byglimps.
import { Boomerang } from "boomerang-lib";
// receives an array of base64 images.
const story = new Boomerang(base64Images);
returns
{ "story": "/path/to/your/boomerang" }
import fs from "fs";
import path from "path"
function base64_encode(filename) {
const filepath = path.resolve(`images/${filename}`);
const bitmap = fs.readFileSync(filepath);
return new Buffer.from(bitmap).toString("base64");
}
- Finalize package creation through npm.