Skip to content

Problem using url filename with space not encoded #29

@andy2mar

Description

@andy2mar

If we have an url image name with space not encoded, for es.
$FastImageSize->getImageSize('https://example.com/some random image.jpg');
the function will not work because the file_get_contents do not accept url not encoded.
As a fix, I propose to automatically encode the filename in the getImage function.
$filename = urldecode($filename);
$filename = dirname($filename) . '/'. rawurlencode(basename($filename));
$this->data = @file_get_contents($filename, null, null, $offset, $length);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions