Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




stream_preview_image [ WordPress Function ]

stream_preview_image ( $post_id )
Defined at:



No description yet.

Source


<?php
function stream_preview_image($post_id) {
    
$post get_post($post_id);
    @
ini_set'memory_limit'apply_filters'admin_memory_limit'WP_MAX_MEMORY_LIMIT ) );
    
$img load_image_to_edit$post_id$post->post_mime_type, array(400400) );

    if ( !
is_resource($img) )
        return 
false;

    
$changes = !empty($_REQUEST['history']) ? json_decodestripslashes($_REQUEST['history']) ) : null;
    if ( 
$changes )
        
$img image_edit_apply_changes($img$changes);

    
// scale the image
    
$w imagesx($img);
    
$h imagesy($img);
    
$ratio _image_get_preview_ratio($w$h);
    
$w2 $w $ratio;
    
$h2 $h $ratio;

    
$preview wp_imagecreatetruecolor($w2$h2);
    
imagecopyresampled$preview$img0000$w2$h2$w$h );
    
wp_stream_image($preview$post->post_mime_type$post_id);

    
imagedestroy($preview);
    
imagedestroy($img);
    return 
true;
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics