[Rt-commit] rt branch, 4.2/subsample-logo, repushed

Alex Vandiver alexmv at bestpractical.com
Tue Jul 1 14:56:17 EDT 2014


The branch 4.2/subsample-logo was deleted and repushed:
       was 15c49d7a97a330b52d5de2288ee8caf99192d001
       now d5d9ff796e1c3fc2701c5b818668bc22ef5c854d

1:  a1d5625 = 1:  8cf72c6 Don't sample every pixel of large logos
2:  3105457 = 2:  c6b3109 gd_can need not be a global
3:  921c001 = 3:  8a6fe3f Do not install a subroutine into the HTML::Mason::Commands namespace
4:  a452b92 = 4:  65d5c64 Replace a needless hashref with a plain hash
5:  4b030a8 = 5:  27963f7 Move List::MoreUtils closer to where it is used
6:  046fa97 = 6:  96488e7 Remove an unnecessary warning triggered by single-colored logos
7:  e6b3c40 = 7:  b6f6e60 Move GD checking into $analyze_img
8:  3a84e3d ! 8:  5fba328 Move $analyze_img earlier
    @@ -10,13 +10,17 @@
      my $imgdata;
      
     -if (my $file_hash = _UploadedFile( 'logo-upload' )) {
    --    my ($id, $msg) = RT->System->SetAttribute( Name => "UserLogo",
    --                                                Description => "User-provided logo",
    --                                                Content => {
    --                                                    type => $file_hash->{ContentType},
    --                                                    data => $file_hash->{LargeContent},
    --                                                    hash => md5_hex($file_hash->{LargeContent}),
    --                                                } );
    +-    my $my_system = RT::System->new( $session{CurrentUser} );
    +-    my ( $id, $msg ) = $my_system->SetAttribute(
    +-        Name        => "UserLogo",
    +-        Description => "User-provided logo",
    +-        Content     => {
    +-            type => $file_hash->{ContentType},
    +-            data => $file_hash->{LargeContent},
    +-            hash => md5_hex($file_hash->{LargeContent}),
    +-        },
    +-    );
    +-
     -    push @results, loc("Unable to set UserLogo: [_1]", $msg) unless $id;
     -
     -    $imgdata = $file_hash->{LargeContent};
    @@ -69,13 +73,17 @@
      };
     +
     +if (my $file_hash = _UploadedFile( 'logo-upload' )) {
    -+    my ($id, $msg) = RT->System->SetAttribute( Name => "UserLogo",
    -+                                                Description => "User-provided logo",
    -+                                                Content => {
    -+                                                    type => $file_hash->{ContentType},
    -+                                                    data => $file_hash->{LargeContent},
    -+                                                    hash => md5_hex($file_hash->{LargeContent}),
    -+                                                } );
    ++    my $my_system = RT::System->new( $session{CurrentUser} );
    ++    my ( $id, $msg ) = $my_system->SetAttribute(
    ++        Name        => "UserLogo",
    ++        Description => "User-provided logo",
    ++        Content     => {
    ++            type => $file_hash->{ContentType},
    ++            data => $file_hash->{LargeContent},
    ++            hash => md5_hex($file_hash->{LargeContent}),
    ++        },
    ++    );
    ++
     +    push @results, loc("Unable to set UserLogo: [_1]", $msg) unless $id;
     +
     +    $imgdata = $file_hash->{LargeContent};
9:  15c49d7 ! 9:  d5d9ff7 Cache the found colors in the logo attribute
    @@ -13,27 +13,19 @@
      };
      
      if (my $file_hash = _UploadedFile( 'logo-upload' )) {
    --    my ($id, $msg) = RT->System->SetAttribute( Name => "UserLogo",
    --                                                Description => "User-provided logo",
    --                                                Content => {
    --                                                    type => $file_hash->{ContentType},
    --                                                    data => $file_hash->{LargeContent},
    --                                                    hash => md5_hex($file_hash->{LargeContent}),
    --                                                } );
     +    $colors = $analyze_img->($file_hash->{LargeContent});
    -+    my ($id, $msg) = RT->System->SetAttribute(
    -+        Name => "UserLogo",
    -+        Description => "User-provided logo",
    -+        Content => {
    -+            type => $file_hash->{ContentType},
    -+            data => $file_hash->{LargeContent},
    -+            hash => md5_hex($file_hash->{LargeContent}),
    ++
    +     my $my_system = RT::System->new( $session{CurrentUser} );
    +     my ( $id, $msg ) = $my_system->SetAttribute(
    +         Name        => "UserLogo",
    +@@
    +             type => $file_hash->{ContentType},
    +             data => $file_hash->{LargeContent},
    +             hash => md5_hex($file_hash->{LargeContent}),
     +            colors => $colors,
    -+        }
    -+    );
    -     push @results, loc("Unable to set UserLogo: [_1]", $msg) unless $id;
    +         },
    +     );
      
    -     $imgdata = $file_hash->{LargeContent};
     @@
              my $content = $attr->Content;
              if (ref($content) eq 'HASH') {



More information about the rt-commit mailing list