Witam,
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);
if(isset($imageData['Make'])) if(isset($imageData['Model'])) $this->imageMeta['model'] = $imageData['Model'];
if(isset($imageData['COMPUTED']['ApertureFNumber'])) { $this->imageMeta['aperture'] = $imageData['COMPUTED']['ApertureFNumber'];//linia619
$this->imageMeta['aperture'] = str_replace('/','',$this->imageMeta['aperture']); }
if(isset($imageData['ExposureTime'])) { $exposure = explode('/',$imageData['ExposureTime']); $exposure = round($exposure[1
]/$exposure[0
],-1
); $this->imageMeta['exposure'] = '1/' . $exposure . ' second';
}
if(isset($imageData['Flash'])) { if($imageData['Flash'] > 0) {
$this->imageMeta['flash'] = 'Yes';
}
else {
$this->imageMeta['flash'] = 'No';
}
}
if(isset($imageData['FocalLength'])) { $focus = explode('/',$imageData['FocalLength']); $this->imageMeta['focalLength'] = round($focus[0
]/$focus[1],2) . ' mm'; }
if(isset($imageData['DateTime'])) { $date = $imageData['DateTime'];
$date = str_replace(':','-',$date[0]) . ' ' . $date[1
]; $this->imageMeta['dateTaken'] = date('m/d/Y g:i A',strtotime($date)); }
}
?>
A tutaj cały kod thumbnail
http://zapisztekst.pl/116Pozdrawiam