L4URO Posted November 19, 2013 Report Share 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 Link to comment Share on other sites More sharing options...
briedis Posted November 19, 2013 Report Share 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 Link to comment Share on other sites More sharing options...
daGrevis Posted November 20, 2013 Report Share Posted November 20, 2013 Ko satur tas .php? Ne jau tak īsto kodu, ne? :D Quote Link to comment Share on other sites More sharing options...
L4URO Posted November 20, 2013 Author Report Share 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 Link to comment Share on other sites More sharing options...
L4URO Posted November 20, 2013 Author Report Share 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 Link to comment Share on other sites More sharing options...
Kasspars Posted November 20, 2013 Report Share Posted November 20, 2013 Tak paskaties kāds ir src tam img tagam, noteikti kaut kas ..../path/to/generate.php Quote Link to comment Share on other sites More sharing options...
marrtins Posted November 20, 2013 Report Share 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 Link to comment Share on other sites More sharing options...
aaxc Posted November 20, 2013 Report Share Posted November 20, 2013 lejuplādēt marrtin, lejuplādēt! Quote Link to comment Share on other sites More sharing options...
L4URO Posted November 21, 2013 Author Report Share Posted November 21, 2013 lejuplādēt marrtin, lejuplādēt! butthurt much ? Quote Link to comment Share on other sites More sharing options...
L4URO Posted November 21, 2013 Author Report Share Posted November 21, 2013 Tak paskaties kāds ir src tam img tagam, noteikti kaut kas ..../path/to/generate.php ja ta ir Quote Link to comment Share on other sites More sharing options...
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.