]> git.imager.perl.org - imager.git/commitdiff
handle key iteration for the simulated %formats correctly
authorTony Cook <tony@develop=help.com>
Mon, 9 Aug 2010 11:59:24 +0000 (11:59 +0000)
committerTony Cook <tony@develop=help.com>
Mon, 9 Aug 2010 11:59:24 +0000 (11:59 +0000)
Imager.pm

index af6942e190fa86e2adb32888fba61e993a9bce68..99c290f07bb0dd443a55da0a497269e4fa8bf11e 100644 (file)
--- a/Imager.pm
+++ b/Imager.pm
@@ -3998,7 +3998,8 @@ sub FIRSTKEY {
 
   unless (@{$self->[IX_LIST]}) {
     # full populate it
-    @{$self->[IX_LIST]} = keys %{$self->[IX_FORMATS]};
+    @{$self->[IX_LIST]} = grep $self->[IX_FORMATS]{$_},
+      keys %{$self->[IX_FORMATS]};
 
     for my $key (keys %{$self->[IX_CLASSES]}) {
       $self->[IX_FORMATS]{$key} and next;