Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect implementation of getBounds2D and getPoint2D #31

Open
GoogleCodeExporter opened this issue Apr 20, 2015 · 1 comment
Open

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Call the getPoint2D or getBounds2D of the ResampleOp

What is the expected output? What do you see instead?
The expected output is the new size of the image and the new location of the 
point

What I see is the size of the source image and the location of the source point

What version of the product are you using? On what operating system?
0.8.5

Here is the fix for AdvancedResizeOp.java

public final Rectangle2D getBounds2D(BufferedImage src) {
    Dimension dstDimension = dimensionConstrain.getDimension(new  Dimension(src.getWidth(),src.getHeight()));
    return new Rectangle(0, 0, dstDimension.width, dstDimension.height);
}

public final Point2D getPoint2D(Point2D srcPt, Point2D dstPt) {
    if (dstPt != null) {
        return dstPt;
    } else {
        Dimension dstDimension = dimensionConstrain.getDimension(new  Dimension(srcPt.x, srcPt.y));
        return new Point2D.Double(dstDimension.width, dstDimension.height);
    }
}

Original issue reported on code.google.com by [email protected] on 29 Nov 2012 at 5:27

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 3 Dec 2012 at 4:04

  • Changed state: Accepted

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

No branches or pull requests

1 participant