Plugin Directory

Changeset 534142


Ignore:
Timestamp:
04/20/2012 04:29:06 PM (14 years ago)
Author:
sewpafly
Message:

1.0.5

Location:
post-thumbnail-editor
Files:
6 added
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • post-thumbnail-editor/tags/1.0.5/README.txt

    r452243 r534142  
    44Tags: post-thumbnail, post thumbnail, featured image, featured, editor, image, awesome
    55Requires at least: 3.2
    6 Tested up to: 3.2.1
     6Tested up to: 3.3.1
    77Stable tag: trunk
    88
     
    6464== Changelog ==
    6565
     66= 1.0.5 =
     67* Fix custom sizes with either height or width set to '0'
     68* Added German translation
     69
    6670= 1.0.4 =
    6771* Added full paths to php includes
     
    99103== Upgrade Notice ==
    100104
     105= 1.0.5 =
     106Bugfix & added German translation
     107
    101108= 1.0.4 =
    102109Bugfixes & portuguese translation
  • post-thumbnail-editor/tags/1.0.5/php/functions.php

    r452241 r534142  
    324324 */
    325325function pte_get_width_height( $size_information, $w, $h ){
     326    $logger = PteLogger::singleton();
    326327    if ( $size_information['crop'] == 1 ){
     328        $logger->debug("GETwidthheightCROPPED");
    327329        $dst_w = $size_information['width'];
    328330        $dst_h = $size_information['height'];
    329331    }
    330332    // Crop isn't set so the height / width should be based on the biggest side
    331     else if ($w > $h){
    332         $dst_w = $size_information['width'];
    333         $dst_h = round( ($dst_w/$w) * $h, 0);
    334     }
     333    // or check if the post_thumbnail has a 0 for a side.
    335334    else {
    336         $dst_h = $size_information['height'];
    337         $dst_w = round( ($dst_h/$h) * $w, 0);
    338     }
    339     $return = compact( "dst_w", "dst_h" );
    340     return $return;
     335        $use_width = false;
     336        if ( $w > $h ) $use_width = true;
     337        if ( $size_information['height'] == 0 ) $use_width = true;
     338        if ( $size_information['width'] == 0 ) $use_width = false;
     339
     340        $logger->debug("GETwidthheightPARAMS\nWIDTH: $w\nHEIGHT: $h\nUSE_WIDTH: $use_width");
     341        if ( $use_width ){
     342            $dst_w = $size_information['width'];
     343            $dst_h = round( ($dst_w/$w) * $h, 0);
     344        }
     345        else {
     346            $dst_h = $size_information['height'];
     347            $dst_w = round( ($dst_h/$h) * $w, 0);
     348        }
     349    }
     350
     351    // Sanity Check
     352    if ( $dst_h == 0 || $dst_w == 0 ){
     353        $logger->error( "Invalid derived dimensions: ${dst_w} x ${dst_h}" );
     354    }
     355    return compact( "dst_w", "dst_h" );
    341356}
    342357
  • post-thumbnail-editor/tags/1.0.5/post-thumbnail-editor.php

    r452241 r534142  
    44   Author: sewpafly
    55   Author URI: http://sewpafly.github.com/post-thumbnail-editor
    6    Version: 1.0.4
     6   Version: 1.0.5
    77   Description: Individually manage your post thumbnails
    88
     
    1010     =======
    1111
    12     Copyright 2011  (email : sewpafly@gmail.com)
     12    Copyright 2012  (email : sewpafly@gmail.com)
    1313
    1414    This program is free software; you can redistribute it and/or modify
     
    3636define( 'PTE_PLUGINPATH', dirname(__FILE__) . "/");
    3737define( 'PTE_DOMAIN', "post-thumbnail-editor");
    38 define( 'PTE_VERSION', "1.0.4");
     38define( 'PTE_VERSION', "1.0.5");
    3939
    4040/*
     
    218218        , false
    219219        , basename( PTE_PLUGINPATH ) . DIRECTORY_SEPARATOR . "i18n" );
     220
    220221?>
  • post-thumbnail-editor/trunk/README.txt

    r452243 r534142  
    44Tags: post-thumbnail, post thumbnail, featured image, featured, editor, image, awesome
    55Requires at least: 3.2
    6 Tested up to: 3.2.1
     6Tested up to: 3.3.1
    77Stable tag: trunk
    88
     
    6464== Changelog ==
    6565
     66= 1.0.5 =
     67* Fix custom sizes with either height or width set to '0'
     68* Added German translation
     69
    6670= 1.0.4 =
    6771* Added full paths to php includes
     
    99103== Upgrade Notice ==
    100104
     105= 1.0.5 =
     106Bugfix & added German translation
     107
    101108= 1.0.4 =
    102109Bugfixes & portuguese translation
  • post-thumbnail-editor/trunk/php/functions.php

    r452241 r534142  
    324324 */
    325325function pte_get_width_height( $size_information, $w, $h ){
     326    $logger = PteLogger::singleton();
    326327    if ( $size_information['crop'] == 1 ){
     328        $logger->debug("GETwidthheightCROPPED");
    327329        $dst_w = $size_information['width'];
    328330        $dst_h = $size_information['height'];
    329331    }
    330332    // Crop isn't set so the height / width should be based on the biggest side
    331     else if ($w > $h){
    332         $dst_w = $size_information['width'];
    333         $dst_h = round( ($dst_w/$w) * $h, 0);
    334     }
     333    // or check if the post_thumbnail has a 0 for a side.
    335334    else {
    336         $dst_h = $size_information['height'];
    337         $dst_w = round( ($dst_h/$h) * $w, 0);
    338     }
    339     $return = compact( "dst_w", "dst_h" );
    340     return $return;
     335        $use_width = false;
     336        if ( $w > $h ) $use_width = true;
     337        if ( $size_information['height'] == 0 ) $use_width = true;
     338        if ( $size_information['width'] == 0 ) $use_width = false;
     339
     340        $logger->debug("GETwidthheightPARAMS\nWIDTH: $w\nHEIGHT: $h\nUSE_WIDTH: $use_width");
     341        if ( $use_width ){
     342            $dst_w = $size_information['width'];
     343            $dst_h = round( ($dst_w/$w) * $h, 0);
     344        }
     345        else {
     346            $dst_h = $size_information['height'];
     347            $dst_w = round( ($dst_h/$h) * $w, 0);
     348        }
     349    }
     350
     351    // Sanity Check
     352    if ( $dst_h == 0 || $dst_w == 0 ){
     353        $logger->error( "Invalid derived dimensions: ${dst_w} x ${dst_h}" );
     354    }
     355    return compact( "dst_w", "dst_h" );
    341356}
    342357
  • post-thumbnail-editor/trunk/post-thumbnail-editor.php

    r452241 r534142  
    44   Author: sewpafly
    55   Author URI: http://sewpafly.github.com/post-thumbnail-editor
    6    Version: 1.0.4
     6   Version: 1.0.5
    77   Description: Individually manage your post thumbnails
    88
     
    1010     =======
    1111
    12     Copyright 2011  (email : sewpafly@gmail.com)
     12    Copyright 2012  (email : sewpafly@gmail.com)
    1313
    1414    This program is free software; you can redistribute it and/or modify
     
    3636define( 'PTE_PLUGINPATH', dirname(__FILE__) . "/");
    3737define( 'PTE_DOMAIN', "post-thumbnail-editor");
    38 define( 'PTE_VERSION', "1.0.4");
     38define( 'PTE_VERSION', "1.0.5");
    3939
    4040/*
     
    218218        , false
    219219        , basename( PTE_PLUGINPATH ) . DIRECTORY_SEPARATOR . "i18n" );
     220
    220221?>
Note: See TracChangeset for help on using the changeset viewer.