1999-11-09 01:39:13 +08:00
|
|
|
#!/usr/bin/perl -w
|
|
|
|
# <sjburges@gimp.org>
|
|
|
|
use Gimp;
|
|
|
|
use Gimp::Fu;
|
|
|
|
use Gimp::Util;
|
|
|
|
# Gimp::set_trace(TRACE_ALL);
|
|
|
|
|
|
|
|
# These are a couple of one-liners that you might find handy. Both should
|
|
|
|
# be undoable w/o any special magick, and work with any gimp.
|
|
|
|
|
2000-01-06 08:30:56 +08:00
|
|
|
#register "layer_to_image_size", "Layer2ImageSize", "Expands layer to image size",
|
|
|
|
# "Seth Burgess", "Seth Burgess <sjburges\@gimp.org>", "1.0",
|
|
|
|
# N_"<Image>/Layers/Layer to Image Size", "RGB*, GRAY*", [ ], sub {
|
|
|
|
# ($img, $layer) = @_;
|
|
|
|
# $layer->resize($img->width, $img->height, $layer->offsets);
|
|
|
|
# return();
|
|
|
|
#};
|
1999-11-09 01:39:13 +08:00
|
|
|
|
|
|
|
register "center_layer", "Center Layer",
|
|
|
|
"Centers the current layer on the image",
|
|
|
|
"Seth Burgess", "Seth Burgess <sjburges\@gimp.org>",
|
1999-11-30 05:46:18 +08:00
|
|
|
"1.0", N_"<Image>/Layers/Center Layer", "RGB*, GRAY*", [], sub {
|
1999-11-09 01:39:13 +08:00
|
|
|
($img, $layer) = @_;
|
|
|
|
$layer->set_offsets(($img->width - $layer->width )/2,
|
|
|
|
($img->height - $layer->height)/2);
|
|
|
|
return();
|
|
|
|
};
|
|
|
|
|
|
|
|
exit main;
|