WordPress.org

Plugin Directory

Changeset 464762


Ignore:
Timestamp:
11/18/11 15:18:00 (2 years ago)
Author:
joehoyle
Message:

sync with git repo

Location:
wp-thumb/trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • wp-thumb/trunk/readme.txt

    r461781 r464762  
    1 === WP Thumb === 
    2  
    3 Contributors: humanmade, mattheu, joehoyle, tcrsavage, willmot 
     1=== WPThumb === 
     2Contributors: humanmade, joehoyle, mattheu, tcrsavage, willmot 
    43Tags: image resize 
    54Requires at least: 3.0 
    6 Tested up to: 3.3 Beta 3 
    7 Stable tag: 1.0 
     5Tested up to: 3.2.1 
     6Stable tag: 0.2 
    87 
    9 On demand image resize generation tighly integrated with WordPress. WP Thumb is aimed at WordPress theme / plugin developers to support on demand image resizing, allowing them to use images like `the_post_thumbail( 'width=100&height=100&crop=1&crop_from_position=top,left' )`. 
     8Gallery and Portfolio management for your WordPress site.  
    109 
    1110== Description == 
    1211 
    13 WP Thumb is a simple plugin that makes use of the PHP Thumb library. It seamlessly intergrates with the WordPress image functions. You can specify height, width and crop values, and an image will be generated, which is then cached for future use.  
     12WPThumb is a simple plugin that makes use of the PHPThumb library. It seamlessly intergrates with the wordpress image functions. You can specify height, width and crop values, and an image will be generated, which is then cached for future use.  
    1413 
    1514= Features = 
    1615 
    17 * Pretty URLs — No ugly ‘phpthumb?args=blah’. More like: ‘uploads/cache/foo-bar-jpg/h456d6.jpg’ 
    18 * Native — WP Thumb directly hooks into all Word­Press image func­tions, use like: ‘the_post_thumbnail( “width=100&height=90&crop=1″ )’ 
    19 * On Demand - The point of WP Thumb is it’s on-demand. Images don’t have to be cre­ated / resized on upload. This makes it infi­nitely more ver­sa­tile when switch­ing theme, redesigns or using old images in new ways. 
    20 * Resiz­ing Options - Specif­i­cally, “crop”, “resize”, “resize-crop” (also know as zoom-crop or adaptive-resize, “crop from position” 
    21 * Manip­u­la­tion Options -  “auto­matic back­ground fill”, “jpeg qual­ity”, “watermarking” 
    22 * Caching - All files are cached on disk in /uploads/cache/ (or wher­ever your uploads dir is set to) 
    23 * File Types - jpg, png, bmp, gif, tiff (via ImageMagick) 
     16* Automatic images resizing, cropping and caching.  
     17* Ideal for when you want to change the dimensions of default image sizes. 
     18* Can extend using filters to make use of any of the phpThumb Library functions by manipulating the image object. 
    2419 
    2520== Changelog == 
    26  
    27 =1.0= 
    28 * Launch! 
    29 * Some more unit tests 
    3021 
    3122=0.4= 
     
    4536== Installation == 
    4637 
    47 1. Upload the 'wpthumb' folder to the '/wp-content/plugins/' directory 
     381. Upload the 'WPThumb' folder to the '/wp-content/plugins/' directory 
    48392. Activate the plugin through the 'Plugins' menu in WordPress 
    4940 
  • wp-thumb/trunk/tests/testFileNames.php

    r461780 r464762  
    7575         
    7676        $this->assertNull( $image->error ); 
    77         $this->assertContains( ABSPATH, $image->getCacheFileDirectory() ); 
    78         $this->assertNotContains( '.', $image->getCacheFileDirectory() ); 
     77        $this->assertContains( home_url(), $image->getCacheFileURL() ); 
     78        $this->assertNotContains( '.', str_replace( array( home_url(), '.' . $image->getFileExtension() ), array( '', '' ), $image->getCacheFileURL() ) ); 
    7979         
    8080    } 
     
    106106    } 
    107107     
    108     function testFilePathFromLocalFileUrlWithDifferentUploadDir() { 
     108    function testFilePathFromLocalFileUrlWithDifferentUploadDirNoMultiSite() { 
     109         
     110        if ( is_multisite() ) 
     111            return; 
    109112     
    110         // For this test we need to change the uplaod URL to something differnt that uplaod path 
     113        // For this test we need to change the upload URL to something other than uplaod path 
    111114        add_filter( 'upload_dir', function( $args ) { 
    112115            $args['url'] = str_replace( 'wp-content/uploads', 'files', $args['url'] ); 
     
    130133     
    131134    } 
     135     
     136    function testGifIsConvertedToPNGInCacheFileName() { 
     137         
     138        $path = dirname( __FILE__ ) . '/images/google.gif'; 
     139        $url = str_replace( ABSPATH, get_bloginfo( 'url' ) . '/', $path ); 
     140         
     141        $image = new WP_Thumb; 
     142        $image->setFilePath( $path ); 
     143         
     144        $this->assertNull( $image->error ); 
     145        $this->assertEquals( end( explode( '.', $image->getCacheFileName() ) ), 'png' ); 
     146         
     147    } 
    132148} 
  • wp-thumb/trunk/tests/testPostThumbnail.php

    r461780 r464762  
    55    function testPostThumbnailResize() { 
    66         
    7         $post_id = 1; 
    8         $post = get_post( $post_id ); 
     7        $post = reset( get_posts( 'showposts=1' ) ); 
    98        $this->assertNotNull( $post->ID, 'test post not found' ); 
    109        $_old_thumbnail = get_post_thumbnail_id( $post->ID ); 
    1110         
    1211        $attachment = reset( get_posts( 'post_type=attachment' ) ); 
     12         
     13        $this->assertFileExists( get_attached_file( $attachment->ID ) ); 
     14         
    1315        $this->assertNotNull( $attachment->ID, 'test attachment not found' ); 
    1416         
  • wp-thumb/trunk/tests/testRemoteImage.php

    r461780 r464762  
    5454         
    5555    } 
     56     
     57    function testDifferentFileURLSWithSameArgs() { 
     58     
     59        $url_1 = 'http://www.google.com/images/srpr/logo3w.png'; 
     60        $image_1 = new WP_Thumb( $url_1, "crop=1&return=path&width=80&height=80&cache=0" ); 
     61 
     62        $url_2 = 'http://www.google.co.uk/images/srpr/logo3w.png'; 
     63        $image_2 = new WP_Thumb( $url_2, "crop=1&return=path&width=80&height=80&cache=0" ); 
     64         
     65        $this->assertNotEquals( $image_1->getCacheFilePath(), $image_2->getCacheFilePath() ); 
     66 
     67    } 
     68     
    5669} 
Note: See TracChangeset for help on using the changeset viewer.