Foros del Web » Creando para Internet » Sistemas de gestión de contenidos »

Fallo en imágen IMAGE GD

Estas en el tema de Fallo en imágen IMAGE GD en el foro de Sistemas de gestión de contenidos en Foros del Web. Quiero mostrar una imágen pero me dice que contiene erroes, este es el código, la verdad es que no localizo el error :S Código PHP: ...
  #1 (permalink)  
Antiguo 10/03/2010, 10:30
Avatar de TheRD  
Fecha de Ingreso: junio-2009
Mensajes: 120
Antigüedad: 14 años, 10 meses
Puntos: 0
Fallo en imágen IMAGE GD

Quiero mostrar una imágen pero me dice que contiene erroes, este es el código, la verdad es que no localizo el error :S

Código PHP:
<?php
/**
*
* @author Original Author Username [email protected] - http://mywebsite.tld
* @author Another Author Username [email protected] - http://domain.tld
*
* @package {PACKAGENAME}
* @version $Id$
* @copyright (c) 2007 Your Group Name
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
define('IN_PHPBB'true);
// Specify the path to you phpBB3 installation directory.
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH './';
$phpEx substr(strrchr(__FILE__'.'), 1);
// The common.php file is required.
include($phpbb_root_path 'common.' $phpEx);

// since we are grabbing the user avatar, the function is inside the functions_display.php file since RC7
include($phpbb_root_path 'includes/functions_display.' $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);

header("Content-type: image/gif");

$id_get $_GET['id'];
settype($id_get'integer');
$id_get mysql_real_escape_string($id_get);

$get_Data mysql_query("SELECT * FROM phpbb_ficha_ninja WHERE user_id='$id_get'");
if(
$fields mysql_fetch_array($get_Data)){

//Our variables containing the text to be displayed.
$var1 $fields['name'];
$var2 $fields['clan'];
$var3 $fields['rank'];
$var4 $fields['level'];
$var5 $fields['fue'];
$var6 $fields['agu'];
$var7 $fields['cck'];
$var8 $fields['pv'];
$var9 $fields['pc'];
$var10 $fields['in_t'];
$var11 $fields['res'];
$var12 $fields['nin'];
$var13 $fields['gen'];
$var14 $fields['tai'];
$var15 $fields['villa'];

//Our font size
$font 3;

//The image the text will be on
$image "images/fichaninja/ficha.gif";
$ficha ImageCreateFromgif("$image"); 

//Text color
$text_color imagecolorallocate ($ficha00,0);//black text

imagestring ($ficha$font12537,  $var1$text_color);
imagestring ($ficha$font12586,  $var2$text_color);
imagestring ($ficha$font26086,  $var3$text_color);
imagestring ($ficha$font37086,  $var4$text_color);
imagestring ($ficha$font22137,  $var5$text_color);
imagestring ($ficha$font100137,  $var6$text_color);
imagestring ($ficha$font177137,  $var7$text_color);
imagestring ($ficha$font253137,  $var8$text_color);
imagestring ($ficha$font330137,  $var9$text_color);
imagestring ($ficha$font30174,  $var10$text_color);
imagestring ($ficha$font108174,  $var11$text_color);
imagestring ($ficha$font183174,  $var12$text_color);
imagestring ($ficha$font255174,  $var13$text_color);
imagestring ($ficha$font330174,  $var14$text_color);

//GET AVATAR
$vatar mysql_query("SELECT user_avatar,username,user_avatar_type,user_avatar_width,user_avatar_height FROM phpbb_users WHERE user_id='$id_get'");
if (
$avatcons mysql_fetch_array($vatar)){
    global 
$user$config$phpbb_root_path$phpEx;

    if (empty(
$avatar) || !$avatar_type || (!$config['allow_avatar'] && !$ignore_config))
    {
        return 
'';
    }

    
$avatar_img '';

    switch (
$avatar_type)
    {
        case 
AVATAR_UPLOAD:
            if (!
$config['allow_avatar_upload'] && !$ignore_config)
            {
                return 
'';
            }
            
$avatar_img $phpbb_root_path "download/file.$phpEx?avatar=";
        break;

        case 
AVATAR_GALLERY:
            if (!
$config['allow_avatar_local'] && !$ignore_config)
            {
                return 
'';
            }
            
$avatar_img $phpbb_root_path $config['avatar_gallery_path'] . '/';
        break;

        case 
AVATAR_REMOTE:
            if (!
$config['allow_avatar_remote'] && !$ignore_config)
            {
                return 
'';
            }
        break;
    }

    
$avatar_img .= $avatar;
$avatar_img str_replace(' ''%20'$avatar_img);
$newwidth 90;
$newheight 90;
$tipo explode('.',$avatar_img);
if (
$tipo[1] == 'gif'){
$source imagecreatefromgif($avatar_img);
}
if (
$tipo[1] == 'jpg'){
$source imagecreatefromjpg($avatar_img);
}
if (
$tipo[1] == 'png'){
$source imagecreatefrompng($avatar_img);
}
#imagecopyresized($ficha, $source, 17, 18, 0, 0, $newwidth, $newheight, $avatcons['user_avatar_width'], $avatcons['user_avatar_height']);
}


// Get new sizes

$villa imagecreatefromgif("images/fichaninja/$var15.gif");

// Resize
#imagecopy($ficha, $villa, 330, 83, 0, 0, 28, 20);
imagegif($ficha);
}

?>
  #2 (permalink)  
Antiguo 11/03/2010, 02:31
Avatar de Willy_N  
Fecha de Ingreso: diciembre-2009
Ubicación: Cádiz
Mensajes: 334
Antigüedad: 14 años, 4 meses
Puntos: 18
Respuesta: Fallo en imágen IMAGE GD

Pues si no comentas con claridad qué errores te dice que tiene nadie será capaz de averiguar nada, es que aquí no abundan los adivinos, y los que hay están todos demasiado ocupados con sus lineas 906...
  #3 (permalink)  
Antiguo 11/03/2010, 07:47
Avatar de TheRD  
Fecha de Ingreso: junio-2009
Mensajes: 120
Antigüedad: 14 años, 10 meses
Puntos: 0
Respuesta: Fallo en imágen IMAGE GD

Ya puse arriba los errores que me dan: La imágen no puede mostrarse porque contiene errores. Simplemente eso me dice.

Etiquetas: fallo, image, phpbb
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 18:47.