Skip to content

Scale is null after uploading image with same dimensions as previous image #247

@elanclarkson

Description

@elanclarkson

Hi there, thanks a lot for this plugin!

There is a bug where the scale property is null in the object returned bygetMetadata() after uploading an image that has the same dimensions as the previous image.

The reason for this is because the scaleRatio property is set automatically via Vue watchers when the width and height change, however when changing images, scaleRatio gets initialised back to null within the _initialize() method. This is fine if the width and height change because the watchers are triggered again, but if the width and height are the same then a change is never triggered and scaleRatio remains null.

I have gotten around this by not setting scaleRatio back to null in the _initialize() method. This works well in my case but I am unsure if it is the best approach to take generally speaking. Happy to submit a PR if you're fine with it though.

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