From fd7572f8b295167d111d3eebadefdbea7b9e4813 Mon Sep 17 00:00:00 2001 From: Davide Arduini Date: Thu, 3 May 2018 11:16:00 +0200 Subject: [PATCH] Update photo.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit la variabile $img viene creata erroneamente perchè quando si applica la funzione 'imagecreatefrom' in gif si applica la creazione .png e viceversa. Questo provoca un errore almomento dell'upload e non si visualizza la foto. --- src/main/php/eu/europa/cedefop/europass/photo.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/php/eu/europa/cedefop/europass/photo.php b/src/main/php/eu/europa/cedefop/europass/photo.php index c138420..30b029a 100644 --- a/src/main/php/eu/europa/cedefop/europass/photo.php +++ b/src/main/php/eu/europa/cedefop/europass/photo.php @@ -40,13 +40,13 @@ fwrite($file,$img_tmp); fclose($file); $image = $upload_path.$ses.'-cv.gif'; - $img = @imagecreatefrompng($image); + $img = @imagecreatefromgif($image); } else if ($photo_type == 'image/png') { $file = fopen($upload_path.$ses.'-cv.png','wb'); fwrite($file,$img_tmp); fclose($file); $image = $upload_path.$ses.'-cv.png'; - $img = @imagecreatefromgif($image); + $img = @imagecreatefrompng($image); } #Resize the image to fit 113x151. @@ -62,4 +62,4 @@ #Destroy the tmp file. imagedestroy($tmp); -?> \ No newline at end of file +?>