[Rt-commit] rt branch, 4.2/gd-suggest, created. rt-4.2.9-62-g9534ce9
Alex Vandiver
alexmv at bestpractical.com
Mon Dec 29 14:06:43 EST 2014
The branch, 4.2/gd-suggest has been created
at 9534ce9ac924ad28b92f5bb1ed30dc9745fd2fe1 (commit)
- Log -----------------------------------------------------------------
commit c51612a10879847c4e6f132247b3e39573439c2e
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Mon Dec 29 14:02:41 2014 -0500
Split the check for GD from the image analysis
d5d9ff79 stopped $analyze_img from being called every time, making it
cached. Unfortunately, $analyze_img did more than its name implied --
it also set $valid_image_types, which is used to decide whether to show
the "GD is disabled" message.
Split the check for if GD is enabled (which should run on every request)
from the image analysis (which still depends on GD being enabled).
Fixes I#30563.
diff --git a/share/html/Admin/Tools/Theme.html b/share/html/Admin/Tools/Theme.html
index 38ef606..5bcbeb2 100644
--- a/share/html/Admin/Tools/Theme.html
+++ b/share/html/Admin/Tools/Theme.html
@@ -244,10 +244,7 @@ my $imgdata;
my $colors;
my $valid_image_types;
-my $analyze_img = sub {
- return undef if RT->Config->Get('DisableGD');
- return undef unless Convert::Color->require;
-
+if (not RT->Config->Get('DisableGD') and Convert::Color->require) {
require GD;
# Always find out what GD can read...
@@ -256,6 +253,10 @@ my $analyze_img = sub {
$gd_can{$type}++ if GD::Image->can("newFrom${type}Data");
}
$valid_image_types = join(", ", map { uc } sort { lc $a cmp lc $b } keys %gd_can);
+}
+
+my $analyze_img = sub {
+ return undef unless $valid_image_types;
my $imgdata = shift;
return undef unless $imgdata;
commit 9534ce9ac924ad28b92f5bb1ed30dc9745fd2fe1
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Mon Dec 29 14:06:16 2014 -0500
Remove List::MoreUtils::uniq import
Importing in a Mason component imports it for all future requests -- and
it is no logner used in this component, after 96488e7c.
diff --git a/share/html/Admin/Tools/Theme.html b/share/html/Admin/Tools/Theme.html
index 5bcbeb2..168a735 100644
--- a/share/html/Admin/Tools/Theme.html
+++ b/share/html/Admin/Tools/Theme.html
@@ -295,7 +295,6 @@ my $analyze_img = sub {
}
}
- use List::MoreUtils qw(uniq);
for (values %colors) {
$_->{rank} = $_->{s} * $_->{cnt};
}
-----------------------------------------------------------------------
More information about the rt-commit
mailing list