/[packages]/cauldron/gimp/current/SOURCES/gimp-scripting-sample.pl
ViewVC logotype

Contents of /cauldron/gimp/current/SOURCES/gimp-scripting-sample.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 24820 - (show annotations) (download)
Wed Jan 19 21:44:22 2011 UTC (11 years, 8 months ago) by ahmad
File MIME type: text/plain
File size: 681 byte(s)
imported package gimp
1 #!/usr/bin/perl
2
3 # For faster multiple execs, start a gimp, and do Xtns/Perl/Server.
4
5 #- (gc) this shit wasted me something like 2 hours: opposedly to what's
6 #- claimed in the doc, we need to precise `:auto' in the imports, grrrrr..
7 use Gimp qw(:consts main xlfd_size :auto);
8
9 Gimp::init();
10 #- disable the following when your script is finished
11 Gimp::set_trace(TRACE_ALL);
12
13 my $img = gimp_file_load("/tmp/t.png", "/tmp/t.png");
14
15 my $w = gimp_image_width($img);
16 my $h = gimp_image_height($img);
17
18 my $rot = gimp_rotate(gimp_image_active_drawable($img), 1, 0.0872664625997165);
19
20 gimp_crop($img, $w, $h, 0, 0);
21
22 gimp_file_save($img, $rot, "/tmp/t_.png", "/tmp/t_.png");
23
24 Gimp::end();
25

  ViewVC Help
Powered by ViewVC 1.1.28