Skip to content

Bug: ImageHandler has no reality checks #2421

Description

@MGatner

Describe the bug
ImageHandler does not do any verification that it has a valid image loaded, which can lead to some errors with unhelpful descriptions. E.g. fit() will try to calculate the aspect ration with a null value, so $xRatio = $width / $origWidth; results in "Division by zero".

I don't know where validation should happen - withFile() is maybe the best bet but doesn't catch instances where developers forget to use it before calling other methods.

CodeIgniter 4 version
develop

Affected module(s)
Image Manipulation Class

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified issues on the current code behavior or pull requests that will fix them

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions