// Name: tiktok-images
// Description: Resize images to fit TikTok's 9:16 aspect ratio and avoid being covered by the UI
// Author: Trevor Atlas
// Twitter: @trevoratlas
// Threads: trevor.atlas
import "@johnlindquist/kit"
const sharp = await npm('sharp');
const { getAverageColor } = await npm('fast-average-color-node');
const width = 1440;
const height = 2400;
const density = 72;
const scale = .8;
const validTypes = new Set(['image/png', 'image/jpeg', 'image/jpg']);
const outputPath = path.join(home(), 'Desktop', 'resized-images');
async function processImage(imageFilepath: string) {
try {