Blitz Posted January 30, 2006 Report Share Posted January 30, 2006 Zinu ka bilzu resaizosana ar imagecreatefromjpeg() imagecreatetruecolor() imagecopyresampled() imagejpeg() imagedestroy() ir laikietilpiga, bet nu tas jau ir bik pa daudz, 8 bilzu resaizosana aiznem 23 sek. seku iemetu kodu kods, varbut kads var pateikt prieksa ja nu es ko daru galigi greizi, un tas ir iemesls lenajai darbibai... reali vajadzes resamplot ap 300 bildem un iznak ka jagaida bus maigi sakot ilgi... Bildes tike resamplotas no 3264 x 2448 uz 150 x ... un 800 x .... Link to comment Share on other sites More sharing options...
v3rb0 Posted January 30, 2006 Report Share Posted January 30, 2006 ja no lielās bildes -> uz vidējo -> uz mazo, tad varbūt kādu sekundi ātrāk resaizos. Link to comment Share on other sites More sharing options...
Blitz Posted January 30, 2006 Author Report Share Posted January 30, 2006 aaa tas var but saistits ar to ka atminu piegruza pilnu pec formulas width*height*deep ? Link to comment Share on other sites More sharing options...
Blitz Posted January 30, 2006 Author Report Share Posted January 30, 2006 (edited) Labi ja jau ar php risinajumi nav, tad varbut to meginat izdarit ar C++. Doma uzstaisit kadu nelielu programmeli kas resamplo bildes taa pat kaa es to daru ar php. Pec tam vinu izsaukt kaut kaa ar system(C:/resize.exe -originalpath -mediumpath -thumbpath) Iznaks tas ieverojami atrak vai ne? Gribetos lai vienu bildi resaizo uz medium un thumb apmeram sekundes laikaa! Varbut kads jau kaut ko lidzigu ir darijis un var padalities ar ieteikumiem. Edited January 30, 2006 by Blitz Link to comment Share on other sites More sharing options...
Roze Posted January 30, 2006 Report Share Posted January 30, 2006 Nu a kas pa kasti (serveri) nav kaads pirmskara? Peec savas pieredzes konverteeju pdfus uz 3000x3000 (aptuveni) imaagi un tad tiek reisaizots uz 3 izmeeriem 800x 400x un 150x.. un taas principaa ir milisekundes.. Link to comment Share on other sites More sharing options...
Blitz Posted January 30, 2006 Author Report Share Posted January 30, 2006 kastei nav ne vainas athlon 2400+ 512 ddr Link to comment Share on other sites More sharing options...
Klez Posted January 30, 2006 Report Share Posted January 30, 2006 vaig uzlikt, lai php var izmantot vairaak atminjas ... ja nemaldos defaultaa ir 8 megabaiti ... uzliec liidz kaadiem 60 :)) un tad paexperimentee :) Link to comment Share on other sites More sharing options...
Blitz Posted January 31, 2006 Author Report Share Posted January 31, 2006 (edited) o vel 2 sekundes, jasavac vairak ar ieteikumiem, moska izdosies zem 10 noraut ;) + vel viena ideja! Tagad es katru bildi (medium un thumb) lieku atminaa atseviski t.i. imagecreatefromjpeg(lielo) un pec tam imagecreatefromjpeg(mazo)! Pienemsim ja es to daritu tikai vienreiz ar $im=imagecreatefromjpeg(lielo) $im_med=imagecreatetruecolor(medium bilde) $im_smal=imagecreatetruecolor(small bilde) imagecopyresampled($im_med, $im, 0, 0, 0, 0, $medium_width, $medium_height, $width, $height); imagecopyresampled($im_smal, $im, 0, 0, 0, 0, $small_width, $small_height, $width, $height); tas samazinatu laiku? Un vai vispar taa var darit? + Problemu atrisinaju. Tatad izmantoju nevis imagecopyresampled() kas izpildijas ~3sek bet imagecopyresized() kas izpildas ~0.5 sek :) Edited January 31, 2006 by Blitz Link to comment Share on other sites More sharing options...
bubu Posted January 31, 2006 Report Share Posted January 31, 2006 ... un kas dod pamatīgi sliktāku kvalitāti (nearest nevis bilineārā filtrācija). Link to comment Share on other sites More sharing options...
Blitz Posted February 1, 2006 Author Report Share Posted February 1, 2006 (edited) Jaa , nau jau kvalitate ipasi spidosa, bet par cik man svarigaks ir laiks ne kvalitate, tad sitais variants nu pilnibaa apmierina. Galvenais lai ieraugot bildi nevajadzetu viebties... Edited February 1, 2006 by Blitz Link to comment Share on other sites More sharing options...
hmnc Posted February 1, 2006 Report Share Posted February 1, 2006 nu nez kādi tev ir kvalitātes kritēriji, bet imagecopyresized() man tiešām liek viebties :) Link to comment Share on other sites More sharing options...
Blitz Posted February 2, 2006 Author Report Share Posted February 2, 2006 Nu nezin, man liekas pienemama kvalitate. imagecopyresized bilde Klientam nav jaiemilas bildeee, bet jaredz ka tada prece ir, un kada vina ir.... :) Link to comment Share on other sites More sharing options...
v3rb0 Posted February 2, 2006 Report Share Posted February 2, 2006 (edited) nav arī jāpērk tā prece, jo tad kad visas izpirks būs jāpasūta jaunas! Edited February 2, 2006 by v3rb0 Link to comment Share on other sites More sharing options...
Recommended Posts