Skip to content

ScaleRatio introduces black border (NaNs) and unnecessary code duplication in ScaleRatio, ScaleKeepAspect and ScaleFixed #102

@h-spiess

Description

@h-spiess

Hey,

I have to switch from the old Augmentor.jl to this package and while converting my code I realized that ScaleRatio introduces a black border. Digging into the code, I saw that this was fixed for ScaleFixed and supposely fixed for ScaleKeepAspect.

I think this slipped through because all of these projections are implemented over and over again. I gave it a shot at unifying the codebase. This fixed the black border issue for ScaleRatio and ScaleKeepAspect.

In ScaleKeepAspect the issue remained sometimes because of the offset of 0.5 while ScaleFixed used an offset of 1.

I think unification additonally helps as, to my understanding, these 3 projections just provide different interfaces to the same scaling projection.

I will add a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions