wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[livejournal] r19121: LJSUP-8867. Only worker (bin/worker/cate...

Committer: gprochaev
LJSUP-8867. Only worker (bin/worker/category-recent-posts) need to resize images

U   trunk/bin/worker/category-recent-posts
U   trunk/cgi-bin/LJ/Browse/Parser.pm
U   trunk/cgi-bin/LJ/Widget/Browse.pm
Modified: trunk/bin/worker/category-recent-posts
===================================================================
--- trunk/bin/worker/category-recent-posts	2011-05-25 02:54:24 UTC (rev 19120)
+++ trunk/bin/worker/category-recent-posts	2011-05-25 04:33:55 UTC (rev 19121)
@@ -80,6 +80,7 @@
                 max_len     => 400,
                 crop_image  => 1,
                 entry       => $e_obj,
+                need_resize => 1,
             );
 
             ## Add tags for every entry

Modified: trunk/cgi-bin/LJ/Browse/Parser.pm
===================================================================
--- trunk/cgi-bin/LJ/Browse/Parser.pm	2011-05-25 02:54:24 UTC (rev 19120)
+++ trunk/cgi-bin/LJ/Browse/Parser.pm	2011-05-25 04:33:55 UTC (rev 19121)
@@ -73,15 +73,20 @@
                             url     => $post->[1],
                         };
                     } else {
-                        $r = LJ::crop_picture_from_web(
-                            source      => $attr->{'src'},
-                            size        => '200x200',
-                            cancel_size => '200x0',
-                            username    => $LJ::PHOTOS_FEAT_POSTS_FB_USERNAME,
-                            password    => $LJ::PHOTOS_FEAT_POSTS_FB_PASSWORD,
-                            galleries   => [ $LJ::PHOTOS_FEAT_POSTS_FB_GALLERY ],
-                        );
-                        $is_new_img = 1;
+                        if ($args{'need_resize'} eq 1) {
+                            $r = LJ::crop_picture_from_web(
+                                source      => $attr->{'src'},
+                                size        => '200x200',
+                                cancel_size => '200x0',
+                                username    => $LJ::PHOTOS_FEAT_POSTS_FB_USERNAME,
+                                password    => $LJ::PHOTOS_FEAT_POSTS_FB_PASSWORD,
+                                galleries   => [ $LJ::PHOTOS_FEAT_POSTS_FB_GALLERY ],
+                            );
+                            $is_new_img = 1;
+                        } else {
+                            $images_crop_cnt--;
+                            next;
+                        }
                     }
                 }
                 if ($images_crop_cnt && $r && ($r->{'status'} ne 'small') && $r->{'url'}) {

Modified: trunk/cgi-bin/LJ/Widget/Browse.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/Browse.pm	2011-05-25 02:54:24 UTC (rev 19120)
+++ trunk/cgi-bin/LJ/Widget/Browse.pm	2011-05-25 04:33:55 UTC (rev 19121)
@@ -283,6 +283,7 @@
                 max_len     => 400,
                 crop_image  => 1,
                 entry       => $entry,
+                need_resize => 0,
             );
             $event = $parsed->{'text'};
             my $images = $parsed->{'images'};

Tags: livejournal, pm, wisest-owl
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