L4URO Posted November 19, 2013 Report Posted November 19, 2013 (edited) (skatīt bildi pielikumā) tā tad es veiksmīgi ģenerēju bildi no teksta,tad ,uzspiežot labo peles taustiņu man ir iespēja "saglabāt attēlu kā " ,bet ,kad uzspiežu man piedāvā saglabāt nevis kā jpeg failu,bet kā php skriptu. Kods,lai uztaisītu bildi (sesija ir tāpēc,ka ienesu saturu no cita faila) : <?php session_start(); header('Content-type: image/jpeg'); $email = $_SESSION['varname']; $email_lenght= strlen ($email); $font_size=4; $image_height = ImageFontHeight ($font_size); $image_width = ImageFontWidth ($font_size) * $email_lenght; $image = imagecreate($image_width, $image_height); imagecolorallocate($image, 255, 255, 255); $font_color = imagecolorallocate($image, 0, 0, 0); imagestring($image, $font_size, 0, 0, $email, $font_color); imagejpeg($image); imagedestroy($image); ?> Edited November 20, 2013 by aaxc Quote
briedis Posted November 19, 2013 Report Posted November 19, 2013 Vari pamēģināt šādu headeri pielikt... header('Content-Disposition: attachment; filename="blabla.jpg"'); nezinu gan, vai strādās :) Quote
daGrevis Posted November 20, 2013 Report Posted November 20, 2013 Ko satur tas .php? Ne jau tak īsto kodu, ne? :D Quote
L4URO Posted November 20, 2013 Author Report Posted November 20, 2013 (edited) Ko satur tas .php? Ne jau tak īsto kodu, ne? :D ja es pats uzlieku .jpg tipu tad ieseivoja kaa bilde bet kad saglabaa kaa php skriptu tad tajaa ieksa ir яШяа JFIF яю >CREATOR: gd-jpeg v1.0 (using IJG JPEG v90), default quality яЫ C $.' ",#(7),01444'9=82<.342яЫ C 2!!222222222222222222222яА P" яД я µ } !1AQa"2Ѓ‘Ў#B±БRСр$3br‚ &(*456789:DEFGHIJSTUWXYZcdefghxyzѓ„…†‡€‰Љ’“”•–—™љўЈ µ !1Aaq"2ЃB‘Ў±Б#3RрbrС sitadu baigi daudz :D Edited November 20, 2013 by L4URO Quote
L4URO Posted November 20, 2013 Author Report Posted November 20, 2013 Vari pamēģināt šādu headeri pielikt... header('Content-Disposition: attachment; filename="blabla.jpg"'); nezinu gan, vai strādās :) strada,man ir ta ka to uzgenereto bildi atver jauna cilnee un tad es gribeju lai cilvekam ir iespeja ieseivot Quote
Kasspars Posted November 20, 2013 Report Posted November 20, 2013 Tak paskaties kāds ir src tam img tagam, noteikti kaut kas ..../path/to/generate.php Quote
marrtins Posted November 20, 2013 Report Posted November 20, 2013 strada,man ir ta ka to uzgenereto bildi atver jauna cilnee un tad es gribeju lai cilvekam ir iespeja ieseivotNu tad skaties, ka tur browserī sakruķīts. Ar Content-Disposition: attachment; bla bla vienmēr piedāvā "nokačāt". Quote
L4URO Posted November 21, 2013 Author Report Posted November 21, 2013 lejuplādēt marrtin, lejuplādēt! butthurt much ? Quote
L4URO Posted November 21, 2013 Author Report Posted November 21, 2013 Tak paskaties kāds ir src tam img tagam, noteikti kaut kas ..../path/to/generate.php ja ta ir Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.