Redlihs Posted November 26, 2008 Report Share Posted November 26, 2008 (edited) Sveiki, Ir neliela problēma. Kad uploadoju bildi uz servera un to resaizoju man izmet brīdinājumu: imagecreatefromjpeg() [function.imagecreatefromjpeg]: '/tmp/phpVUBNBT' is not a valid JPEG file in /home/www/metroons.org/upd.php on line 7 Un bildi rāda melnu. Šādi notiek tikai dažām bildēm. Edited November 27, 2008 by Redlihs Link to comment Share on other sites More sharing options...
marcis Posted November 26, 2008 Report Share Posted November 26, 2008 Manuprāt diezgan skaidri norādīts uz problēmu /tmp/phpVUBNBT' is not a valid JPEG file. Es minēšu - šīs brīdinājums parādas tām bildēm, kuras nav jpeg? Link to comment Share on other sites More sharing options...
Redlihs Posted November 26, 2008 Author Report Share Posted November 26, 2008 Nē visas ir jpeg Link to comment Share on other sites More sharing options...
bubu Posted November 26, 2008 Report Share Posted November 26, 2008 Kā tu zini, ka visas ir jpeg? Link to comment Share on other sites More sharing options...
mounkuls Posted November 26, 2008 Report Share Posted November 26, 2008 (edited) Laikam kaut kas nav resaizojot. Faila nosaukumos nav kadi simboli kurus nesagremo pareizi? Edited November 26, 2008 by mounkuls Link to comment Share on other sites More sharing options...
Redlihs Posted November 27, 2008 Author Report Share Posted November 27, 2008 Nosaukumā viss kārtībā. Visas bildes ir ņemtas no viena avota- dažas iet, dažas neiet. Link to comment Share on other sites More sharing options...
Redlihs Posted November 27, 2008 Author Report Share Posted November 27, 2008 Reku ir skripts: $file=$_FILES['bilde']['tmp_name']; $src=imagecreatefromjpeg($file); list($width, $height)=getimagesize($file); $new_width=350; $new_height=($height/$width)*$new_width; $tmp=imagecreatetruecolor($new_width, $new_height); $resample=imagecopyresampled($tmp, $src, 0, 0, 0, 0, $new_width, $new_height, $width, $height); $uploaddir='images/sportisti/'; $filename=urldecode(basename($_FILES['bilde']['name'])); $uploadfile=$uploaddir. $filename; $upim=imagejpeg($tmp, $uploadfile, 100); Link to comment Share on other sites More sharing options...
mounkuls Posted November 27, 2008 Report Share Posted November 27, 2008 (edited) Bet kaut kas jau tanī stadijā nav kā vajag. Varbūt uzliec kādu bildi oriģinālajā izmēra, kura paliek melna pēc upload+resize... Nav īsti saprotams, jo dažas paņem un dažas ne tas resizer. Koda gabalu tam resaizerim jau laikam nerādīsi? EDIT: Opā, nepamaniju, ka koda gabalu jau ieliki:) Ieliec pa starpām lai padrukā ārā $file un $uploadfile lai redz kas tur iznāk par nosaukumiem Edited November 27, 2008 by mounkuls Link to comment Share on other sites More sharing options...
marcis Posted November 27, 2008 Report Share Posted November 27, 2008 Tas, ka visām bildēm ir .jpg paplašinājums vēl nenozīmē, ka viņas tiešām ir jpeg. Paskaties, ko rāda $_FILES['bilde']['type'] vai $size=getimagesize($file); echo $size['mime']; Link to comment Share on other sites More sharing options...
Redlihs Posted November 27, 2008 Author Report Share Posted November 27, 2008 Ar nosaukumiem viss izskatās kārtībā. Pārbaudīju: file_type= image/jpeg Pamanīju, ka problēmas ir ar tām bildēm, kas ņemtas no interneta un iepriekš jau samazinātas. Link to comment Share on other sites More sharing options...
Pentiums Posted November 27, 2008 Report Share Posted November 27, 2008 par drošību neesi domājis? http://metroons.org/update_sportisti.php?sport_id=60 Link to comment Share on other sites More sharing options...
marcis Posted November 27, 2008 Report Share Posted November 27, 2008 Itkā nebūtu svarīgi, no kurienes bildes nākušas. Php saka, ka tas nav valids jpeg attēls... Link to comment Share on other sites More sharing options...
Klez Posted November 27, 2008 Report Share Posted November 27, 2008 http://metroons.org/sportisti_profile.php?sport_id=60 :) Link to comment Share on other sites More sharing options...
marrtins Posted November 27, 2008 Report Share Posted November 27, 2008 Uzmet to jpeg, lai var apskatīt. Link to comment Share on other sites More sharing options...
rpr Posted November 27, 2008 Report Share Posted November 27, 2008 jpg arii ir vairaaki veidi. piejauju, ka tas ko tu tur gribi resaizot ir progresive jpg jeb image/pjpg. Link to comment Share on other sites More sharing options...
Recommended Posts