Due to an earlier gravity setting, the canvas might be positioned incorrectly. Not sure if other canvas operations may have the same problem.

Solution:
Add "-gravity None" to the define canvas operations to reset any gravity setting.

Comments

fietserwin’s picture

Title: Define canvas on imagemagick might fail due to earlier -gravity settings » Canvas effects using imagemagick might fail due to earlier -gravity settings

Fixed and committed.

Effects that exposed this bug:
- Define canvas
- Overlay (watermark)
- Underlay (background)
- Overlay: source image to canvas

Image mask doesn't as you cannot define a position for the mask.

This style shows this bug (overlay, underlay and source to canvas all use the same code: so solve 1 = solve all):
a:5:{s:4:"isid";s:2:"46";s:4:"name";s:12:"test-1999140";s:6:"module";N;s:7:"storage";i:1;s:7:"effects";a:5:{i:140;a:12:{s:5:"label";s:7:"Schalen";s:4:"help";s:131:"Door te schalen worden de originele verhoudingen behouden. Als één van de dimensies wordt ingevuld zal de andere worden berekend.";s:15:"effect callback";s:18:"image_scale_effect";s:19:"dimensions callback";s:22:"image_scale_dimensions";s:13:"form callback";s:16:"image_scale_form";s:13:"summary theme";s:19:"image_scale_summary";s:6:"module";s:5:"image";s:4:"name";s:11:"image_scale";s:4:"data";a:3:{s:5:"width";s:3:"200";s:6:"height";s:0:"";s:7:"upscale";i:1;}s:4:"ieid";s:3:"140";s:4:"isid";s:2:"46";s:6:"weight";s:3:"-10";}i:141;a:12:{s:5:"label";s:5:"Tekst";s:4:"help";s:47:"Add static or dynamic (coded) text to an image.";s:22:"dimensions passthrough";b:1;s:13:"form callback";s:23:"image_effects_text_form";s:15:"effect callback";s:25:"image_effects_text_effect";s:13:"summary theme";s:26:"image_effects_text_summary";s:6:"module";s:18:"image_effects_text";s:4:"name";s:18:"image_effects_text";s:4:"data";a:12:{s:4:"size";s:2:"20";s:4:"xpos";s:6:"center";s:4:"ypos";s:6:"center";s:6:"halign";s:5:"right";s:6:"valign";s:6:"bottom";s:3:"RGB";a:1:{s:3:"HEX";s:6:"000000";}s:5:"alpha";s:3:"100";s:5:"angle";s:1:"0";s:8:"fontfile";s:74:"sites/all/modules/imagecache_actions/image_effects_text/Komika_display.ttf";s:11:"text_source";s:4:"text";s:4:"text";s:12:"Hello World!";s:3:"php";s:21:"return 'Hello World!'";}s:4:"ieid";s:3:"141";s:4:"isid";s:2:"46";s:6:"weight";s:2:"-9";}i:142;a:12:{s:5:"label";s:13:"Define canvas";s:4:"help";s:109:"Define the size of the working canvas and background color, this controls the dimensions of the output image.";s:15:"effect callback";s:33:"canvasactions_definecanvas_effect";s:19:"dimensions callback";s:37:"canvasactions_definecanvas_dimensions";s:13:"form callback";s:31:"canvasactions_definecanvas_form";s:13:"summary theme";s:34:"canvasactions_definecanvas_summary";s:6:"module";s:24:"imagecache_canvasactions";s:4:"name";s:26:"canvasactions_definecanvas";s:4:"data";a:4:{s:3:"RGB";a:1:{s:3:"HEX";s:6:"ff0000";}s:5:"under";i:1;s:5:"exact";a:4:{s:5:"width";s:3:"300";s:6:"height";s:3:"300";s:4:"xpos";i:0;s:4:"ypos";i:0;}s:8:"relative";a:4:{s:8:"leftdiff";s:0:"";s:9:"rightdiff";s:0:"";s:7:"topdiff";s:0:"";s:10:"bottomdiff";s:0:"";}}s:4:"ieid";s:3:"142";s:4:"isid";s:2:"46";s:6:"weight";s:2:"-8";}i:144;a:12:{s:5:"label";s:5:"Tekst";s:4:"help";s:47:"Add static or dynamic (coded) text to an image.";s:22:"dimensions passthrough";b:1;s:13:"form callback";s:23:"image_effects_text_form";s:15:"effect callback";s:25:"image_effects_text_effect";s:13:"summary theme";s:26:"image_effects_text_summary";s:6:"module";s:18:"image_effects_text";s:4:"name";s:18:"image_effects_text";s:4:"data";a:12:{s:4:"size";s:2:"20";s:4:"xpos";s:6:"center";s:4:"ypos";s:6:"center";s:6:"halign";s:5:"right";s:6:"valign";s:6:"bottom";s:3:"RGB";a:1:{s:3:"HEX";s:6:"000000";}s:5:"alpha";s:3:"100";s:5:"angle";s:1:"0";s:8:"fontfile";s:74:"sites/all/modules/imagecache_actions/image_effects_text/Komika_display.ttf";s:11:"text_source";s:4:"text";s:4:"text";s:12:"Hello World!";s:3:"php";s:21:"return 'Hello World!'";}s:4:"ieid";s:3:"144";s:4:"isid";s:2:"46";s:6:"weight";s:2:"-7";}i:143;a:12:{s:5:"label";s:19:"Overlay (watermark)";s:4:"help";s:101:"Choose the file image you wish to use as an overlay, and position it in a layer on top of the canvas.";s:15:"effect callback";s:31:"canvasactions_file2canvas_image";s:22:"dimensions passthrough";b:1;s:13:"form callback";s:30:"canvasactions_file2canvas_form";s:13:"summary theme";s:33:"canvasactions_file2canvas_summary";s:6:"module";s:24:"imagecache_canvasactions";s:4:"name";s:25:"canvasactions_file2canvas";s:4:"data";a:4:{s:4:"xpos";s:4:"left";s:4:"ypos";s:6:"bottom";s:5:"alpha";s:3:"100";s:4:"path";s:18:"misc/druplicon.png";}s:4:"ieid";s:3:"143";s:4:"isid";s:2:"46";s:6:"weight";s:2:"-6";}}}

fietserwin’s picture

Assigned: fietserwin » Unassigned
Status: Active » Fixed

...

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.