[Rawstudio-dev] [PATCH] Fix crash when cropping
Anders Brander
anders at brander.dk
Fri Jan 5 17:12:01 CET 2007
Hi,
Replying to myself...
The problem was fixed by calculating the correct sizes in
drawingarea_expose(), update_preview_region() and rs_image16_transform()
(I hope).
On Thu, 2007-01-04 at 22:29 +0100, Anders Brander wrote:
> > The width and height of the notroi preview image was miscalculated
> > though their width and height were already available... use previous
> > values and fix the crash eventually.
>
> This fixes the crash-at-hand, but the problem is deeper than this.
>
> The problem is related to calculating size of an image after transform.
> We have to solve a few problems.
>
> Calculate size in rs_image16_transform(), rs_image16_bilinear() and
> rs_image16_transform_getwh(). If we transform an image (scale=1.0,
> angle=0.0, crop=NULL) with the dimensions w * h we'll end up with an
> image with the dimensions (w-1) * (h-1).
Fixed.
>
> Some problems:
> - calculating interpolation along edges.
Done by extending.
> - placing a pixel in real plane. Is x.0,y.0 at the corner or at the
> center of a pixel?
It makes most sense to put it in the corner.
> - How should we round non-integer sizes?
Still hasn't figured this one out ;)
/abrander
More information about the Rawstudio-dev
mailing list