Salve ragazzi, sto utilizzando la classe hft_image che consente di fare delle operazioni sulle immagini....questa classe funziona solo per alcuni tipi di immagine, infatti il metodo imagecreatefromfile fa dei controlli per vedere se il tipo di immagine caricata è supportata.
In dettaglio una parte della funzione imagecreatefromfile è la seguente:
Codice PHP:
function imagecreatefromfile($img_file){
global $ERR;
$img=0;
$img_sz = getimagesize( $img_file ); ## returns array with some properties like dimensions and type;
####### Now create original image from uploaded file. Be carefull! GIF is often not supported, as far as I remember from GD 1.6
switch( $img_sz[2] ){
case 1:
$img = $this->_imagecheckandcreate("ImageCreateFromGif", $img_file);
$img_type = "GIF";
break;
case 2:
$img = $this->_imagecheckandcreate("ImageCreateFromJpeg", $img_file);
$img_type = "JPG";
break;
case 3:
$img = $this->_imagecheckandcreate("ImageCreateFromPng", $img_file);
$img_type = "PNG";
break;
// would be nice if this function will be finally supported
case 4:
$img = $this->_imagecheckandcreate("ImageCreateFromSwf", $img_file);
$img_type = "SWF";
break;
default:
$img = 0;
$img_type = "UNKNOWN";
$this->error($ERR["IMG_NOT_SUPPORTED"]." $img_file");
break;
L'immagine che ho carico è JPEG e il risultato che mi viene dato è che il tipo di immagine non è supportato. A cosa puo essere dovuto questo msg visto che il formato JPEG è supportato?
Grazie