19 lines
834 B
JavaScript
19 lines
834 B
JavaScript
import fs from "fs/promises";
|
|
import path from "path";
|
|
import { fileURLToPath } from "url";
|
|
import { getDateInFilename, getTimeInFilename,getImageDate } from "./watermark.js";
|
|
|
|
//console.log(getTimeInFilename("WhatsApp Image 2023-08-04 at 6.41.57 PM"));
|
|
// const __filename = fileURLToPath(import.meta.url);
|
|
// const __dirname = path.dirname(__filename);
|
|
// const imagesFolderPath = path.join(__dirname, "images/5");
|
|
// const images = await fs.readdir(imagesFolderPath, { withFileTypes: true });
|
|
// const imagess = images
|
|
// .filter((dirent) => dirent.isFile())
|
|
// .map((dirent) => dirent.name);
|
|
|
|
// for (const imagename of imagess) {
|
|
// console.log(await getImageDate(imagename,'./images/5'));
|
|
// }
|
|
|
|
console.log(getImageDate("IMG_5880~photo.JPG","/home/robertchan/projects/new-project/images/3/")) |