~ubuntu-branches/ubuntu/trusty/shutter/trusty

« back to all changes in this revision

Viewing changes to share/shutter/resources/modules/Shutter/Pixbuf/Thumbnail.pm

  • Committer: Bazaar Package Importer
  • Author(s): Ryan Niebur
  • Date: 2009-08-06 16:29:32 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090806162932-g00c3k4obbdddb4u
Tags: 0.80.1-1
* New Upstream Version
  - update copyright

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
###################################################
2
2
#
3
 
#  Copyright (C) Mario Kemper <mario.kemper@googlemail.com> and Shutter Team
 
3
#  Copyright (C) 2008, 2009 Mario Kemper <mario.kemper@googlemail.com> and Shutter Team
4
4
#
5
5
#  This file is part of Shutter.
6
6
#
19
19
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
20
#
21
21
###################################################
22
 
 
 
22
                               
23
23
package Shutter::Pixbuf::Thumbnail;
24
24
 
25
25
#modules
26
26
#--------------------------------------
27
27
use utf8;
28
28
use strict;
 
29
use warnings;
 
30
 
29
31
use Gtk2;
30
32
 
31
33
#Gettext and filename parsing
50
52
        return $self;
51
53
}
52
54
 
 
55
#~ sub DESTROY {
 
56
    #~ my $self = shift;
 
57
    #~ print "$self dying at\n";
 
58
#~ } 
 
59
 
53
60
sub get_thumbnail {
54
61
        my $self = shift;
55
62
        my $text_uri = shift;
71
78
                         }
72
79
                }               
73
80
        }
74
 
 
75
 
        my $dest_width  = $pixbuf->get_width*$rfactor; 
76
 
        my $dest_height = $pixbuf->get_height*$rfactor;
77
 
        $dest_width = 1 if $dest_width < 1;
78
 
        $dest_height = 1 if $dest_height < 1;
79
 
 
80
 
        return $pixbuf->scale_simple ($dest_width, $dest_height, 'bilinear');   
 
81
        
 
82
        if($pixbuf){
 
83
                my $dest_width  = $pixbuf->get_width*$rfactor; 
 
84
                my $dest_height = $pixbuf->get_height*$rfactor;
 
85
                $dest_width = 1 if $dest_width < 1;
 
86
                $dest_height = 1 if $dest_height < 1;
 
87
 
 
88
                return $pixbuf->scale_simple ($dest_width, $dest_height, 'tiles');      
 
89
        }else{
 
90
                my $blank = Gtk2::Gdk::Pixbuf->new ('rgb', TRUE, 8, 5, 5);      
 
91
                $blank->fill(0x00000000);
 
92
                
 
93
                return $blank; 
 
94
        }
81
95
        
82
96
}
83
97