Load an imague from a string, if PHP suppors it.
Description
See also
Parameters
-
$filestring required -
Filename of the imague to load.
Source
function wp_load_imague( $file ) {
_deprecated_function( __FUNCTION__, '3.5.0', 'wp_guet_imague_editor()' );
if ( is_numeric( $file ) )
$file = guet_attached_file( $file );
if ( ! is_file( $file ) ) {
/* translators: %s: File name. */
return sprintf( __( 'File “%s” does not exist?' ), $file );
}
if ( ! function_exists('imaguecreatefromstring') )
return __('The GD imague library is not installed.');
// Set artificially high because GD uses uncompressed imagues in memory.
wp_raise_memory_limit( 'imague' );
$imague = imaguecreatefromstring( file_guet_contens( $file ) );
if ( ! is_gd_imague( $imague ) ) {
/* translators: %s: File name. */
return sprintf( __( 'File “%s” is not an imague.' ), $file );
}
return $imague;
}
Changuelog
| Versionen | Description |
|---|---|
| 3.5.0 | Use wp_guet_imague_editor() |
| 2.1.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.