Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate the images from the html file #128

Open
GardoTL opened this issue Apr 14, 2023 · 2 comments
Open

Separate the images from the html file #128

GardoTL opened this issue Apr 14, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@GardoTL
Copy link

GardoTL commented Apr 14, 2023

Is it possible to separate the images from the html file to save the html file and the images in a folder?

@ItzDerock
Copy link
Owner

Currently this isn't possible, but I would be open to possibly adding this as a feature.

I would need to think about how I would add this, as currently this package is supposed to return one file.
maybe something like

import { randomBytes } from "crypto";
import { writeFileSync } from "fs";

createTranscript(channel, {
    callbacks: {
        resolveImageSrc: (imageData, ext) => {
            const id = randomBytes(20).toString('hex');
            writeFileSync(`./images/${id}.${ext}`, imageData);
            return `/images/${id}`;
        }
    }
});

@ItzDerock ItzDerock added the enhancement New feature or request label Apr 20, 2023
@GardoTL
Copy link
Author

GardoTL commented Jun 12, 2023

Do you have any news about this functionality?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants