GNOME Bugzilla – Bug 585488
Perspective transformation on a layer with a mask causes crash
Last modified: 2009-06-17 19:20:52 UTC
Attached script will reproduce. For a script to reproduce this bug, it has to do the following: 1. Apply a perspective transformation on a layer that has a layer mask, stretching it beyond the bounds of the image. 2. Increase the canvas size to at least the layer size. I'm running Windows XP SP3 and GIMP 2.6.6. Run the attached script from "File/Create/crash-test"
It seems there's no way to attach a file, so here's the script the reproduces the crash: (define (crash-test) (let* ( (img (car (gimp-image-new 100 100 RGB))) (layer1 (car (gimp-layer-new img 100 100 RGB-IMAGE "Background" 100 NORMAL-MODE))) (layer1-mask (car (gimp-layer-create-mask layer1 0))) ) (gimp-image-add-layer img layer1 0) (gimp-layer-add-mask layer1 layer1-mask) (gimp-palette-set-foreground '(255 127 0)) (gimp-edit-fill layer1 FOREGROUND-FILL) (gimp-drawable-transform-perspective layer1 0 0 100 0 0 150 100 150 0 2 0 3 0) (gimp-image-resize-to-layers img) (gimp-display-new img) ) ) (script-fu-register "crash-test" "crash-test" "crash-test" "Public Domain" "Public Domain" "2009" "") (script-fu-menu-register "crash-test" "<Image>/File/Create")
Created attachment 136359 [details] This script crashes gimp
Confirming for the 2.6.6 provided by Jernej.
Also confirmed for 2.6.6 I also tried this from the python.console, and it crashes too. Also, it seems to be a problem with other transforms, just using the pdb call to rotate a layer that has a mask causes gimp to crash: (gimp-drawable-transform-rotate-default layer 0.5 TRUE 0 0 TRUE 0)
I fixed this locally, but it needs slightly more complex hacks for rotate and flip, will commit in a while.
Fixed in master and gimp-2-6: commit e2d90e3e1fb08182c5a47928663b52310536e050 Author: Michael Natterer <mitch@gimp.org> Date: Wed Jun 17 21:14:32 2009 +0200 Bug 585488 – Perspective transformation on a layer with a mask causes crash (gimp_drawable_transform_affine) (gimp_drawable_transform_flip) (gimp_drawable_transform_rotate): also transform the layer mask if we are transforming a layer and there is no selection (which causes the entire layer to be transformed). app/core/gimpdrawable-transform.c | 43 +++++++++++++++++++++++++++++++++++++ 1 files changed, 43 insertions(+), 0 deletions(-)