Deprecated: Assigning the return value of new by reference is deprecated in /home/controlz/public_html/blog/wp-settings.php on line 472

Deprecated: Assigning the return value of new by reference is deprecated in /home/controlz/public_html/blog/wp-settings.php on line 487

Deprecated: Assigning the return value of new by reference is deprecated in /home/controlz/public_html/blog/wp-settings.php on line 494

Deprecated: Assigning the return value of new by reference is deprecated in /home/controlz/public_html/blog/wp-settings.php on line 530

Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with Walker::start_lvl(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 594

Strict Standards: Declaration of Walker_Page::end_lvl() should be compatible with Walker::end_lvl(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 594

Strict Standards: Declaration of Walker_Page::start_el() should be compatible with Walker::start_el(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 594

Strict Standards: Declaration of Walker_Page::end_el() should be compatible with Walker::end_el(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 594

Strict Standards: Declaration of Walker_PageDropdown::start_el() should be compatible with Walker::start_el(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 611

Strict Standards: Declaration of Walker_Category::start_lvl() should be compatible with Walker::start_lvl(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 705

Strict Standards: Declaration of Walker_Category::end_lvl() should be compatible with Walker::end_lvl(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 705

Strict Standards: Declaration of Walker_Category::start_el() should be compatible with Walker::start_el(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 705

Strict Standards: Declaration of Walker_Category::end_el() should be compatible with Walker::end_el(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 705

Strict Standards: Declaration of Walker_CategoryDropdown::start_el() should be compatible with Walker::start_el(&$output) in /home/controlz/public_html/blog/wp-includes/classes.php on line 728

Strict Standards: Redefining already defined constructor for class wpdb in /home/controlz/public_html/blog/wp-includes/wp-db.php on line 306

Deprecated: Assigning the return value of new by reference is deprecated in /home/controlz/public_html/blog/wp-includes/cache.php on line 103

Strict Standards: Redefining already defined constructor for class WP_Object_Cache in /home/controlz/public_html/blog/wp-includes/cache.php on line 425

Deprecated: Assigning the return value of new by reference is deprecated in /home/controlz/public_html/blog/wp-includes/query.php on line 21

Deprecated: Assigning the return value of new by reference is deprecated in /home/controlz/public_html/blog/wp-includes/theme.php on line 623

Strict Standards: Redefining already defined constructor for class WP_Dependencies in /home/controlz/public_html/blog/wp-includes/class.wp-dependencies.php on line 15

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/controlz/public_html/blog/wp-settings.php:472) in /home/controlz/public_html/blog/wp-content/plugins/si-captcha-for-wordpress/si-captcha.php on line 31

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/controlz/public_html/blog/wp-settings.php:472) in /home/controlz/public_html/blog/wp-content/plugins/si-captcha-for-wordpress/si-captcha.php on line 31

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GoogleSitemapGeneratorLoader::Enable() should not be called statically in /home/controlz/public_html/blog/wp-includes/plugin.php on line 311
script completo redimensionar imagenes transparentes en php | formatic.cat

script redimensionar imagenes gif’s y png’s transparentes


Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-content/plugins/ig_syntax_hilite/geshi.php on line 2056

Este post es la continuación de redimensionar imagens gif y png transparentes

Ahora un ejemplo completo donde tenemos una función que nos pasan el string de una imagen y devolvemos ese string redimensionado. Esta preparado para utilizarse al recoger la información de un formulario con imagenes. Del Array $_FILES[] obtendremos el string de la imagen tal que así

PHP:
  1. $stringConLaFoto=file_get_contents($_FILES[$nombre_Foto_Formulario]['tmp_name']);
  2.  
  3. $extensión=$_FILES[$nombre_Foto_Formulario]['type'];
  4.  
  5. $ancho=150;
  6.  
  7. //ahora llamamos a la funcion de redimensionar
  8.  
  9. $imagen_redimensionada=redimensionarImatge($stringConLaFoto,$extension,$ancho)

PHP:
  1. #************************************************************************************
  2. #    redimensionaImatge:
  3. #
  4. #    Donada una imatge es redimensiona a l'amplada o alçada passades com a paràmetre.
  5. #    Si no se li passen les mesures, s'agafaran les dimensions de les variables
  6. #    globals, que es troben a l'inicialitzador, MIDA_IMATGE_AMPLADA i MIDA_IMATGE_ALCADA
  7. #
  8. #    Autor: Marc + Cristian en  controlzeta.net
  9. #    Fecha creacion: 24/04/08
  10.  
  11. #  ultima modificacion 28/08/2008
  12. #
  13. #************************************************************************************
  14.  
  15. function redimensionarImatge($imatge,$extensio,$amplada=FALSE,$alcada=FALSE) {
  16. $original = imagecreatefromstring($imatge);
  17. $mides[] = imagesx($original); // $mides[0] ANCHURA
  18. $mides[] = imagesy($original); //  $mides[1] ALTURA
  19.  
  20. //echo '<br>AMPLADA R:'.$amplada;
  21. //echo '<br>AMPLADA R:'.$alcada;
  22. //echo '<br>AMPLADA:'.$mides[0];
  23. //echo '<br>AMPLADA:'.$mides[1];
  24.  
  25. if ( !( ($mides[0]==$amplada or $amplada==FALSE) AND ($mides[1]== $alcada or $alcada==FALSE) ) ){ //comprueba Que no se redimendsione al mismo tamaño Critian 19-08-2008
  26.  
  27. if($amplada || $alcada) {
  28. $midaHoritzontal = $amplada;
  29. $midaVertical = $alcada;
  30.  
  31. if( $alcada && ($mides[0]>(2*$mides[1])) ) {
  32. unset($alcada);
  33. $midaHoritzontal = 100;
  34. } elseif(!$alcada) {
  35. $midaVertical = $mides[1];
  36. }
  37. } elseif($mides[0] <= MIDA_IMATGE_AMPLADA && $mides[1] <= MIDA_IMATGE_ALCADA) {
  38. $midaHoritzontal = $mides[0];
  39. $midaVertical = $mides[1];
  40. $noRedimensionar = true;
  41. } else {
  42. $midaHoritzontal = MIDA_IMATGE_AMPLADA;
  43. $midaVertical = MIDA_IMATGE_ALCADA;
  44. }
  45. }else{
  46. $midaHoritzontal = $mides[0];
  47. $midaVertical = $mides[1];
  48. $noRedimensionar = true;
  49. }
  50.  
  51. if(!isset($noRedimensionar)) {
  52. unset($imatge);
  53.  
  54. if($midaHoritzontal) {
  55. $ratio = ($mides[0]/$midaHoritzontal);
  56. $midaVertical = round($mides[1]/$ratio);
  57. } else {
  58. $ratio = ($mides[1]/$midaVertical);
  59. $midaHoritzontal = round($mides[0]/$ratio);
  60. }
  61.  
  62. $thumb = imagecreatetruecolor($midaHoritzontal,$midaVertical);
  63.  
  64. switch($extensio) {
  65. case 'image/pjpeg':
  66. case 'image/jpeg':
  67. imagecopyresampled($thumb,$original,0,0,0,0,$midaHoritzontal,$midaVertical,$mides[0],$mides[1]);
  68. imagejpeg($thumb,'../tempImage');
  69. break;
  70.  
  71. case 'image/gif':
  72. case 'image/png':
  73. $colorTransparancia=imagecolortransparent($original);// devuelve el color usado como transparencia o -1 si no tiene transparencias
  74. if($colorTransparancia!=-1){ //TIENE TRANSPARENCIA
  75. //unset($thumb);
  76. //$thumb = imagecreatetruecolor($midaHoritzontal,$midaVertical);
  77.  
  78. $colorTransparente = imagecolorsforindex($original, $colorTransparancia); //devuelve un array con las componentes de lso colores RGB + alpha
  79. $idColorTransparente = imagecolorallocatealpha($thumb, $colorTransparente['red'], $colorTransparente['green'], $colorTransparente['blue'], $colorTransparente['alpha']); // Asigna un color en una imagen retorna identificador de color o FALSO o -1 apartir de la version 5.1.3
  80.  
  81. imagefill($thumb, 0, 0, $idColorTransparente);// rellena de color desde una cordenada, en este caso todo rellenado del color que se definira como transparente
  82. imagecolortransparent($thumb, $idColorTransparente); //Ahora definimos que en el nueva imagen el color transparente será el que hemos pintado el fondo.
  83. imagecopyresampled($thumb,$original,0,0,0,0,$midaHoritzontal,$midaVertical,$mides[0],$mides[1]);// copia y redimensiona un trozo de imagen
  84. //imagecopyresized
  85. }
  86.  
  87. switch ($extensio){
  88. case 'image/gif':
  89. imagegif($thumb,'../tempImage');
  90. break;
  91. case 'image/png':
  92. imagepng($thumb,'../tempImage');
  93. break;
  94. }
  95.  
  96. default:
  97. imagecopyresampled($thumb,$original,0,0,0,0,$midaHoritzontal,$midaVertical,$mides[0],$mides[1]);
  98. imagejpeg($thumb,'../tempImage');
  99.  
  100. break;
  101. }
  102.  
  103. //Lliurem la memòria
  104. unset($original);
  105. unset($thumb);
  106.  
  107. if (function_exists('file_get_contents')) {
  108. $imatge = file_get_contents('../tempImage');
  109. } elseif ($file_to_insert_size = filesize('../tempImage')) {
  110. $imatge = fread(fopen('../tempImage', 'rb'), $file_to_insert_size);
  111. }
  112.  
  113. //eliminació de la imatge del servidor
  114. @unlink('../tempImage');
  115.  
  116. }
  117.  
  118. return $imatge;
  119.  
  120. }

En este escript no se tienen en cuenta la redimension de imagenes gif animadas.

Etiquetas: , , , , , ,

8 comentarios para “script redimensionar imagenes gif’s y png’s transparentes”


  1. Deprecated: Function ereg() is deprecated in /home/controlz/public_html/blog/wp-content/plugins/google-analyticator/google-analyticator.php on line 399
    jon dice:

    Aupa,

    Estoy redimensionando un png. Es una imágen de una camiseta. Lo que hay afuera de la camiseta es blanco y lo de dentro, transparente. Primero lo he intentado con mi propio script y la parte blanca la deja blanca pero lo transparente lo convierte en negro. He probado con el tuyo e igual. Se te ocurre alguna forma de solucionarlo, para que lo transparente salga transparente?

    Gracias. Un saludo. jon


  2. Deprecated: Function ereg() is deprecated in /home/controlz/public_html/blog/wp-content/plugins/google-analyticator/google-analyticator.php on line 399
    cristian dice:

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-includes/kses.php on line 947

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/controlz/public_html/blog/wp-includes/kses.php on line 948

    Hola,

    Has probado con la funcion imagecopyresized, sustituyedo a imagecopyresampled ?

    Estas seguro que entra por las extensiones correctas?

    has leido el otro post? http://blog.controlzeta.net/?tag=hacer-miniaturas-de-imagenes-con-fondo-transparente-gif

    el escript funciona, prueba con otra imagen, existe alguna imagen que daba problemas.

    tambien puedes verificar que la funcion de php imagecolortransparent te devuelva un color.

    saludos,
    Cristian


  3. Deprecated: Function ereg() is deprecated in /home/controlz/public_html/blog/wp-content/plugins/google-analyticator/google-analyticator.php on line 399
    jon dice:

    Aupa,

    Gracias Cristina por tu pronta respuesta! Se agaradece.

    Al final, lo he conseguido con imagecopyresampled y imagesavealpha.

    Saludos,
    Jon


  4. Deprecated: Function ereg() is deprecated in /home/controlz/public_html/blog/wp-content/plugins/google-analyticator/google-analyticator.php on line 399
    Hashattack dice:

    Aixo no funciona nano. Ho he provat de totes les maneres


  5. Deprecated: Function ereg() is deprecated in /home/controlz/public_html/blog/wp-content/plugins/google-analyticator/google-analyticator.php on line 399
    Hashattack dice:

    Escolta noi, aquest codi no funciona!


  6. Deprecated: Function ereg() is deprecated in /home/controlz/public_html/blog/wp-content/plugins/google-analyticator/google-analyticator.php on line 399
    cristian dice:

    Puedes explicarnos cual es el error que te da? para poderte ayudar? el código lo tenemos funcionando en alguna página y funciona bien.

    Puede ser error de la configuración del php, que no tengas la librería, o simplemente la imagen de entrada, no sea adecuada.

    Si detallas que te pasa te ayudamos.

    salutacions :P


  7. Deprecated: Function ereg() is deprecated in /home/controlz/public_html/blog/wp-content/plugins/google-analyticator/google-analyticator.php on line 399
    principiodual dice:

    Ese codigo está más malo que el carrizo, todo da error, los if tienen errores de sintaxis, no aceptan los ";", no se porque se suben siempre codigos que nunca funcionan, de todas maneras gracias por el "intento de ayudar" y dar una mera idea de como redimensionar, realmente sospecho de su funcionamiento.


  8. Deprecated: Function ereg() is deprecated in /home/controlz/public_html/blog/wp-content/plugins/google-analyticator/google-analyticator.php on line 399
    cristian dice:

    Pues funciona perfectamente y compila.... Como lo has copiado? Hay que darle a plain text, para copiarlo primero...

    redimensiona imagenes.

Deja un comentario

CAPTCHA Image Audio Version
Reload Image