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 |
|