After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 606551 - reflect & rotate increase buffer height/width
reflect & rotate increase buffer height/width
Status: RESOLVED OBSOLETE
Product: GEGL
Classification: Other
Component: operations
git master
Other Linux
: Normal normal
: ---
Assigned To: Default Gegl Component Owner
Default Gegl Component Owner
Depends on:
Blocks:
 
 
Reported: 2010-01-10 12:45 UTC by Debarshi Ray
Modified: 2018-05-22 12:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Code to reproduce the bug (1.23 KB, text/x-csrc)
2010-01-10 12:45 UTC, Debarshi Ray
Details

Description Debarshi Ray 2010-01-10 12:45:04 UTC
Created attachment 151123 [details]
Code to reproduce the bug

The reflect and rotate operations increase the buffer's height and width by 2 and when saved as PNG and they are seen as 2 transparent rows and columns.
Comment 1 Martin Nordholts 2010-01-10 16:10:45 UTC
Just a reminder to ourselves: When we fix this we should not forget to add a regression test. This is typical bug that has a tendency to come back.
Comment 2 Debarshi Ray 2010-01-10 18:24:40 UTC
In current Git master, the extra pixels are black and not transparent.
Comment 3 Debarshi Ray 2010-01-13 01:11:39 UTC
From what I understood by reading the code:

static void
gegl_sampler_linear_init (GeglSamplerLinear *self)
{
  GEGL_SAMPLER (self)->context_rect.x = 0;
  GEGL_SAMPLER (self)->context_rect.y = 0;
  GEGL_SAMPLER (self)->context_rect.width = 2;
  GEGL_SAMPLER (self)->context_rect.height = 2;
  GEGL_SAMPLER (self)->interpolate_format = babl_format ("RaGaBaA float");
}

Now the sampler->context_rect.width and sampler->context_rect->height gets added to the result in gegl_affine_get_bounding_box and gegl_affine_get_required_for_output leading to the increase in the width and height by 2.
Comment 4 Jon Nordby 2011-09-03 18:13:29 UTC
Confirmed, 3 black pixels are added to the image.

Thanks for easy way to reproduce.
Comment 5 Øyvind Kolås (pippin) 2012-04-05 15:30:23 UTC
Whether the additional pixel data is black or transparent depends on whether the original buffer has an alpha component or not.

This is perhaps only to be considered a valid bug for rotations of 90, 180 and 270 degrees, since additional pixels will be needed to compute correct antialiasing for other cases.
Comment 6 Vilson Vieira 2015-09-29 16:01:56 UTC
Confirmed, crop:rotate adds ~1px rows/columns for some angles (agreed, it seems that only happens for 90, 180, 270 degrees, sometimes).

After applying changes suggested by comments on operations/transform-core.c (https://gist.github.com/automata/10b5d47a4db6a19f3554), borders went away. However, that broke some composition tests (e.g. colors, adding borders to each tile).

Maybe something related with sub-pixel transform?
Comment 7 GNOME Infrastructure Team 2018-05-22 12:04:43 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gegl/issues/9.