Başka bir şey sayfada olur php görüntü oluşturma çalışır

0 Cevap

Ben bir görüntü oluşturmak ve döndürmek için php kod parçası kullanıyorum. Ben sadece içeri yalan img.php çağırdığınızda ve mükemmel çalışıyor

I başka, ya da sadece bir şey img.php eklemeyi deneyin ama eğer sadece bana QuestionMarks bir çok yerine bir görüntü gösterir (aynı sunucuda) başka bir sayfaya pasajı bulunmaktadır.

Benim duygu sorunun gönderilen başlıklarına ilgili olduğunu, ama dürüstçe ben hiçbir fikrim yok.

Bu yararlı hale nasıl Herhangi bir öneriniz yüzden başka bir sayfaya dahil edilebilir ve hala çalışır?

<?php 
   header("Content-type: image/jpeg"); 
   // option one  
  // create a 250*77 image 
  $im = imagecreate(250, 77); 
  // option two  
  // creating a image from jpeg  
  $im = @imagecreatefromjpeg("images/test.jpg")  
  or die("Cannot Initialize new GD image stream"); 

  // white background and black text 
  $bg = imagecolorallocate($im, 255, 255, 255); 
  $textcolor = imagecolorallocate($im, 0, 0, 0); 

 //create the text
  $skrivetekst = date('d.m.Y');
    $skrivetekst2 = date('H:i:s');

 // write the string at the top left 
  imagestring($im, 5, 0, 0, $skrivetekst, $textcolor); 
  imagestring($im, 5, 0, 20, $skrivetekst2, $textcolor); 


 ///Rotate the image 
$rotate = imagerotate($im, 90, 0);
  // output the image 


// Output
imagejpeg($rotate);


  ImageDestroy ($rotate); 
?>

Selamlar Troels

0 Cevap