Типа я (zilogic) wrote in changelog,
Типа я
zilogic
changelog

[livejournal] r21437: LJSUP-11548: Bad working placeholders

Committer: amyshkin
LJSUP-11548: Bad working placeholders
U   trunk/cgi-bin/cleanhtml.pl
Modified: trunk/cgi-bin/cleanhtml.pl
===================================================================
--- trunk/cgi-bin/cleanhtml.pl	2012-03-16 12:30:42 UTC (rev 21436)
+++ trunk/cgi-bin/cleanhtml.pl	2012-03-16 13:12:42 UTC (rev 21437)
@@ -1152,6 +1152,16 @@
 
                     # don't use placeholders for small images
                     if ( $opts->{'img_placeholders'} ) {
+                        if ( exists $hash->{style} ) {
+                            if ( $hash->{style} =~ /width\:\s*(\d+)(?:px)?\;/i ) {
+                                $hash->{width} = $1;
+                            }
+
+                            if ( $hash->{style} =~ /height\:\s*(\d+)(?:px)?\;/i ) {
+                                $hash->{height} = $1;
+                            }
+                        }
+
                         if ( exists $hash->{width} && $hash->{width} && exists $hash->{height} && $hash->{height} ) {
                             if ( $hash->{'width'} > 140 && $hash->{'height'} > 37 ) {
                                 $img_bad = 1;

Tags: amyshkin, livejournal, pl, zilogic
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