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

feat: extended image download opts #169

Merged
merged 3 commits into from
Sep 13, 2024

Conversation

ItzDerock
Copy link
Owner

@ItzDerock ItzDerock commented Feb 10, 2024

Fixes #166, #137, #128

Adds a resolveImageSrc callback with type:

/**
* Callback used to save an image attachment.
* The returned string is the URL that will be used in the transcript.
*
* `undefined` indicates to use the original attachment URL.
* `null` indicates to not include the attachment in the transcript.
* `string` indicates to use the returned URL as the attachment URL (base64 or remote image).
*/
export type ResolveImageCallback = (
attachment: APIAttachment,
message: APIMessage
) => Awaitable<string | null | undefined>;

Introduces a TranscriptImageDownloader builder:
image

Compression, in my testing, was able to turn a 3.3MB png to a 37KB WebP image with no noticeable quality change unless you really zoom in.

What needs to be done before merging:

  • Figure out a way to document all of this
  • more testing

@ItzDerock ItzDerock merged commit 68e664c into master Sep 13, 2024
3 checks passed
@ItzDerock ItzDerock deleted the feat/extended-image-download-opts branch September 13, 2024 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Define Maximum Output File Size for Discord HTML Transcripts
1 participant