Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[livejournal] r23446: LJSUP-14494 (Save user's picture sizes f...

Committer: ailyin
LJSUP-14494 (Save user's picture sizes for pictures with width less than 900 px)
U   trunk/cgi-bin/cleanhtml.pl
Modified: trunk/cgi-bin/cleanhtml.pl
===================================================================
--- trunk/cgi-bin/cleanhtml.pl	2012-12-10 12:47:06 UTC (rev 23445)
+++ trunk/cgi-bin/cleanhtml.pl	2012-12-10 12:50:54 UTC (rev 23446)
@@ -1106,6 +1106,17 @@
 
                     if ($opts->{'extractimages'}) { $img_bad = 1; }
 
+                    if ( my $maxwidth = $opts->{'maximgwidth'} ) {
+                        my $width = $hash->{'width'};
+                        if ( $width && $width !~ /\%$/ ) {
+                            $width =~ s/\D//g;
+                            if ( int $width > $maxwidth ) {
+                                delete $hash->{'width'};
+                                delete $hash->{'height'};
+                            }
+                        }
+                    }
+
                     # don't use placeholders for small images
                     if ( $opts->{'img_placeholders'} ) {
                         if ( exists $hash->{style} ) {
@@ -1131,20 +1142,6 @@
                             delete $hash->{height} if exists $hash->{height};
                             $img_bad = 1;
                         }
-
-                    } elsif ( my $maxwidth = $opts->{'maximgwidth'} ) {
-                        $img_bad = 0;
-
-                        my $width = $hash->{'width'};
-                        if ( $width && $width !~ /\%$/ ) {
-                            $width =~ s/\D//g;
-                            if ( int $width > $maxwidth ) {
-                                delete $hash->{'width'};
-                                delete $hash->{'height'};
-                            }
-                        }
-
-                        #$img_bad = 1 if ( $opts->{'img_placeholders'} );
                     } else {
                         $img_bad = 0;
                     }

Tags: ailyin, andy, livejournal, pl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments