Przy próbie wgrywania zdjęcia o rozszerzeniu .png występuje taki problem:
Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg: JPEG library reports unrecoverable error: in /home/goo/public_html/adres.pl/widgets/thumbnail.inc.php on line 152 Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: 'zdjecia/29.jpg' is not a valid JPEG file in /home/goo/public_html/adres.pl/widgets/thumbnail.inc.php on line 152 Warning: exif_read_data(29.jpg) [function.exif-read-data]: File not supported in /home/goo/public_html/adres.pl/widgets/thumbnail.inc.php on line 613 Warning: imagecopyresampled() expects parameter 2 to be resource, boolean given in /home/goo/public_html/adres.pl/widgets/thumbnail.inc.php on line 329
Jeśli wgrywam zdjęcie .jpg to problem nie występuje. Jak to naprawić?
Tutaj linie:
152:
<? switch($this->format) { case 'GIF': $this->oldImage = ImageCreateFromGif($this->fileName); break; case 'JPG': $this->oldImage = ImageCreateFromJpeg($this->fileName); //linia 152 break; case 'PNG': $this->oldImage = ImageCreateFromPng($this->fileName); break; } ?>
linia 329
<? ImageCopyResampled( $this->workingImage, $this->oldImage, 0, 0, 0, 0, $this->newDimensions['newWidth'], $this->newDimensions['newHeight'], $this->currentDimensions['width'], $this->currentDimensions['height'] );//linia 329 ?>
linia 613
<? if(function_exists("exif_read_data") && $this->format == 'JPG') { $imageData = exif_read_data($this->fileName); $this->imageMeta['model'] = $imageData['Model']; $this->imageMeta['aperture'] = $imageData['COMPUTED']['ApertureFNumber'];//linia619 } $this->imageMeta['exposure'] = '1/' . $exposure . ' second'; } if($imageData['Flash'] > 0) { $this->imageMeta['flash'] = 'Yes'; } else { $this->imageMeta['flash'] = 'No'; } } } $date = $imageData['DateTime']; } } ?>
A tutaj cały kod thumbnail
http://zapisztekst.pl/116
Pozdrawiam