Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem z wyświetlaniem JPEG
cronik
post
Post #1





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 24.01.2011

Ostrzeżenie: (0%)
-----


Chcę wstawić w stronę obrazek, który leży na innym dysku niż PHP.
Plik nazywa się image.php:

  1. <?php
  2.  
  3. header("Content-type: image/jpg");
  4. $string = "watermark";
  5. $im = imagecreatefromjpeg("Y:/show/4fun/MM_fft_181002073.jpg");
  6. $orange = imagecolorallocate($im, 220, 210, 60);
  7. $px = (imagesx($im) - 7.5 * strlen($string)) / 2;
  8. imagestring($im, 3, $px, 9, $string, $orange);
  9. imagejpeg($im, 'test.jpg');
  10. imagejpeg($im);
  11. imagedestroy($im);
  12. ?>


Po wpisaniu http://.../image.php tworzony jest plik test.jpg ale nie pokazuje się nic w przeglądarce (IMG:style_emoticons/default/sad.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
cronik
post
Post #2





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 24.01.2011

Ostrzeżenie: (0%)
-----


Część php.ini wygląda ta:

;;;;;;;;;;;;;;;;;;
; Fopen wrappers ;
;;;;;;;;;;;;;;;;;;

; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
; http://php.net/allow-url-fopen
allow_url_fopen = On

; Whether to allow include/require to open URLs (like http:// or ftp://) as files.
; http://php.net/allow-url-include
allow_url_include = Off

ale i tak nie działa (IMG:style_emoticons/default/sad.gif)

i jeszcze jedno: jak usunę linię
header("Content-type: image/jpg");

to pokazuje się zawartość (oczywiście w postaci "krzaków")
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 16.10.2025 - 08:40