GitHub Image Resizer

Convert GitHub markdown image uploads to HTML <img> tags with customizable width; supports drag-drop, paste, and attachment button uploads.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

Autor
miked49er
Denně instalací
0
Celkem instalací
1
Hodnocení
0 0 0
Verze
1.3
Vytvořeno
11. 06. 2025
Aktualizováno
11. 06. 2025
Size
4,7 KB
Licence
MIT
Spustit na

📐 Tampermonkey GitHub Image Resizer

A Tampermonkey userscript that automatically converts uploaded image Markdown in GitHub Pull Requests into an HTML <img> tag with a customizable width.

This tool supports all GitHub image upload methods — including drag-and-drop, paste, and the attachment button — and ensures consistent visual layout for embedded images.


🚀 Features

  • 🖼️ Automatically converts this:

    ![alt text](https://github.com/user-attachments/assets/...)
    

    into:

    <img src="https://github.com/user-attachments/assets/..." alt="alt text" width="300">
    
  • ✅ Supports all image upload methods:

    • Drag-and-drop from desktop 💾
    • Clipboard paste 📋
    • Attachment button 📎
  • 🔁 Converts image Markdown to HTML <img> on-the-fly — no need to manually edit it.

  • ⚙️ Customizable width via Tampermonkey menu

  • 🧠 Intelligent detection even when GitHub silently updates the comment box after uploads


🧩 Installation

  1. Install Tampermonkey:

  2. Install the script:

    • From GreasyFork
    • Or manually:
    • Click the Tampermonkey icon → "Create a new script"
    • Paste contents of github-pr-image-to-html.user.js
    • Save

🛠 How to Set Custom Image Width

  1. Click the Tampermonkey icon in your browser.
  2. Open the menu for "GitHub PR Image to HTML (Custom Width)".
  3. Click "Set Image Width".
  4. Enter a value (e.g. 400) to apply that width (in pixels) to all converted images.

Your setting is stored and applied persistently across sessions.


🔒 Privacy

  • ✅ The script only runs on https://github.com/*
  • ❌ It does not send or store any data externally
  • ✅ Your preferences are stored locally in Tampermonkey

📤 Contributing

Pull requests are welcomed for:

  • Additional customizations (e.g. height, class, max-width)
  • Theme-aware image styling
  • Integration with GitHub Markdown preview styling

📄 License

MIT License — see LICENSE


🧪 Example

Before Upload:

Oredered Listocat

After Upload (Automatically):

Ordered Listocat