Bug 2488 - Rotating image 180� offsets it by 1 pixel
Summary: Rotating image 180� offsets it by 1 pixel
Alias: None
Product: cairo
Classification: Unclassified
Component: image backend (show other bugs)
Version: 0.9.3
Hardware: All All
: high normal
Assignee: Carl Worth
QA Contact: cairo-bugs mailing list
Depends on:
Reported: 2005-02-07 09:02 UTC by Kristian Høgsberg
Modified: 2006-06-16 15:29 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:

PNG showing the problem (410 bytes, image/png)
2005-02-07 09:03 UTC, Kristian Høgsberg
C code to generate the PNG (1.68 KB, text/plain)
2005-02-07 09:03 UTC, Kristian Høgsberg
proposed pix for the problem (2.25 KB, patch)
2005-09-16 10:56 UTC, Bertram Felgenhauer
Details | Splinter Review
Similar patch for fb in xserver (2.11 KB, patch)
2006-06-16 15:29 UTC, Kristian Høgsberg
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kristian Høgsberg 2005-02-07 09:02:31 UTC
See attached PNG.  The image surface consisting of the red square and the black
outline is rotated 180° and composited onto the target surface.  The black
outline marks the edge of the image.  The yellow square marks the area where the
black outline should be, but as can be seen from the PNG the black square is
offset 1 pixel down and to the right.  Part of the black outline is clipped
because of this.
Comment 1 Kristian Høgsberg 2005-02-07 09:03:27 UTC
Created attachment 1848 [details]
PNG showing the problem
Comment 2 Kristian Høgsberg 2005-02-07 09:03:59 UTC
Created attachment 1849 [details]
C code to generate the PNG
Comment 3 James Henstridge 2005-07-01 00:44:54 UTC
Are you sure you are rotating around the right axis? (i.e. not half a pixel out
in the X and Y direction?)
Comment 4 Carl Worth 2005-08-22 17:14:21 UTC
Move bugs against "cvs" version to "0.9.3" so we can remove the "cvs" version.
Comment 5 Bertram Felgenhauer 2005-09-16 10:56:35 UTC
Created attachment 3296 [details] [review]
proposed pix for the problem

See also:

[pixman] Changelog:

2005-09-16  Bertram Felgenhauer  <int-e@gmx.de>

	Bug #2488

	* src/fbcompose.c (fbFetchSourcePict, fbFetchTransformed): use the
	center of the pixel as the sampling point for rendering.

	* src/fbcompose.c (fbFetchTransformed): give source image values
	maximim effect in the center of the corresponding pixel.
Comment 6 Kristian Høgsberg 2006-06-13 17:14:18 UTC
Patch comitted and test cases updated.  Thanks.
Comment 7 Kristian Høgsberg 2006-06-13 22:15:56 UTC
Link to git commit:

Comment 8 Kristian Høgsberg 2006-06-16 15:29:35 UTC
Created attachment 5946 [details] [review]
Similar patch for fb in xserver

The bug is also present in the x server, attached patch is a port of the pixman
patch to fb.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.