Skip to content

Image size issue for images with wrong extension. #52

@Mitrij

Description

@Mitrij

Hello.
I've faced an issue when image size can't be obtained for images with wrong extension (for example jpeg image format with PNG extension). Yes, I know it is not normal to have image with wrong extension, but sometimes it happens.

I found this issue parsing "Lullabot\AMP" issue (laravel). It doesn't convert "img" tag to "amp-img" when image size is undefined. So I have a solution, but I think there could be better one.

So my simple solution is for class "FastImageSize", function "getImageSize" you can add this to end of else statement:

if(!(sizeof($this->size) > 1)) { $this->data = ''; $this->getImagesizeUnknownType($file); }

Thanks.

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