Biel. 9 Denunciar post Postado Março 9, 2015 Boa noite a todos. Direto ao ponto. Pessoal, gostaria que imagecreatefromjpeg | imagecreatefrompng | imagecreatefromgif ficasse dentro de uma só tag e não em tags separadas conforme exemplo abaixo <?php $temp = $_FILES['imagem']['tmp_name']; $jpeg = imagecreatefromjpeg($temp); //jpeg imagecopyresampled($jpeg); ?> ... <?php $temp = $_FILES['imagem']['tmp_name']; $png = imagecreatefrompng($temp); //png imagecopyresampled($png); ?> ... <?php $temp = $_FILES['imagem']['tmp_name']; $gif = imagecreatefromgif($temp); //gif imagecopyresampled($gif); ?> ... <table width="344" border="0" cellpadding="5" cellspacing="5"> <tr> <td width="96" height="34" align="right">Buscar_imagem</td> <td width="218"><input type="file" name="imagem" required value="" /></td> </tr> <tr> <td height="70" colspan="3" valign="bottom"><input type="submit" name="botaocss" value="Salvar Cadastro" /></td> </tr> </table> Compartilhar este post Link para o post Compartilhar em outros sites
Marcelo Lipienski 9 Denunciar post Postado Março 9, 2015 E qual seu código até agora? Compartilhar este post Link para o post Compartilhar em outros sites
Williams Duarte 431 Denunciar post Postado Março 9, 2015 Verifique qual o mime-type da imagem e crie uma função, apesar que já existe de kilo na net <?php // RAY_temp_andrey.php error_reporting(E_ALL); $file = 'http://laprbass.com/RAY_EE_images/headshot.png'; $file = 'http://laprbass.com/RAY_EE_images/headshot.jpg'; $file = 'http://laprbass.com/RAY_EE_images/headshot.gif'; $what = getimagesize($file); switch(strtolower($what['mime'])) { case 'image/png': $img = imagecreatefrompng($file); break; case 'image/jpeg': $img = imagecreatefromjpeg($file); break; case 'image/gif': $img = imagecreatefromgif($file); break; default: die(); } $new = imagecreatetruecolor($what[0],$what[1]); imagecopy($new,$img,0,0,0,0,$what[0],$what[1]); header('Content-Type: image/jpeg'); imagejpeg($new); imagedestroy($new); Compartilhar este post Link para o post Compartilhar em outros sites
Biel. 9 Denunciar post Postado Março 10, 2015 Williams, muito obrigado. Aqui funcionou muito bem. Questão resolvida, grato! :D Compartilhar este post Link para o post Compartilhar em outros sites