Please bookmark this page to avoid losing your image tool!

Image Domain Address Finder

(Free & Supports Bulk Upload)

Drag & drop your images here or

The result will appear here...
You can edit the below JavaScript code to customize the image tool.
/**
 * Tries to find the domain name from the source URL of an image.
 *
 * @param {HTMLImageElement} originalImg The original image object.
 * @returns {HTMLElement} An HTML element displaying the found domain or an error message.
 */
function processImage(originalImg) {
    const resultContainer = document.createElement('div');
    resultContainer.style.padding = '20px';
    resultContainer.style.fontFamily = 'Arial, sans-serif';
    resultContainer.style.textAlign = 'center';
    resultContainer.style.border = '1px solid #eee';
    resultContainer.style.borderRadius = '8px';
    resultContainer.style.backgroundColor = '#f9f9f9';
    resultContainer.style.maxWidth = '100%';
    resultContainer.style.boxSizing = 'border-box';

    const imageUrl = originalImg.src;

    // Check if the source is a valid URL from which we can extract a domain.
    // Data URIs, blob URIs, etc., do not have a domain.
    try {
        if (!imageUrl || imageUrl.startsWith('data:') || imageUrl.startsWith('blob:')) {
            throw new Error("Source is not a remote URL.");
        }

        const url = new URL(imageUrl);
        const domain = url.hostname;

        resultContainer.innerHTML = `
            <p style="font-size: 16px; margin: 0 0 10px 0; color: #555;">Image Domain Found:</p>
            <p style="font-size: 24px; font-weight: bold; margin: 0; color: #007bff; word-break: break-all;">${domain}</p>
        `;

    } catch (e) {
        console.error("Could not parse image URL:", e);
        resultContainer.innerHTML = `
            <p style="font-size: 16px; margin: 0 0 10px 0; color: #d9534f;">Could not find a domain.</p>
            <p style="font-size: 12px; margin: 0; color: #777;">
                The image might be from a local file or a data URL, which doesn't have a web domain.
            </p>
        `;
    }

    return resultContainer;
}

Free Image Tool Creator

Can't find the image tool you're looking for?
Create one based on your own needs now!

Description

The Image Domain Address Finder is a tool designed to extract and display the domain name from the source URL of an image. This can be particularly useful for web developers, designers, and digital marketers who need to determine the origin of images used in projects. By simply uploading an image, users can quickly find out which website or service hosts the image, helping to ensure proper attribution and understand usage rights. The tool handles valid remote URLs and provides clear feedback for unsupported formats.

Leave a Reply

Your email address will not be published. Required fields are marked *