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(saveImageFromUrl): Dynamic Extension Handling #1514

Merged
merged 1 commit into from
Jan 7, 2024

Commits on Jan 7, 2024

  1. feat(saveImageFromUrl) Dynamic Extension Handling:

    - Enhanced the `saveImageFromUrl` function to dynamically handle file extensions based on the content type of the fetched image.
    - Replaced the method of appending a '.png' extension with a more robust approach using regular expressions and the path module.
    - Allows for correct extension replacement or addition, ensuring filename consistency and compatibility with the actual image format.
    - Prevents issues with double extensions (e.g., 'someimage.jpg.png') and aligns saved file types with their respective content types.
    danny-avila committed Jan 7, 2024
    Configuration menu
    Copy the full SHA
    0eec1f0 View commit details
    Browse the repository at this point in the history