Skip to content

Add converting from URL#11

Open
strawberry-raccoon wants to merge 3 commits intoswe-productivity:mainfrom
strawberry-raccoon:add-from-url
Open

Add converting from URL#11
strawberry-raccoon wants to merge 3 commits intoswe-productivity:mainfrom
strawberry-raccoon:add-from-url

Conversation

@strawberry-raccoon
Copy link

@strawberry-raccoon strawberry-raccoon commented Feb 8, 2026

Closes #7

Copy link
Collaborator

@C4illin C4illin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done! Just two minor comments

import { randomUUID } from "node:crypto";

const getFilename = (url: string, headers: Headers) => {
const contentDisposition = headers.get("Content-Disposition");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it doesn't contain the Content-Disposition header nor include a proper filename in the url, maybe we could use content-type header? It would require a big map though.

For example, I tested with unsplash and the images doesn't contain a file extension which causes the converted image to then only be named after the file extension. Test with converting this for example https://images.unsplash.com/photo-1464550838636-1a3496df938b

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, #13 adds mime which has that map.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in ebae0f1

@C4illin C4illin self-assigned this Feb 16, 2026
strawberry-raccoon and others added 2 commits February 22, 2026 14:54
Co-authored-by: Emrik Östling <emrik.ostling@gmail.com>
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.

Feature: Option to convert from URL

2 participants