ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Alexey Morsov <samurai@ricom.ru>
To: ALT Linux Community <community@altlinux.ru>
Subject: [Comm] [OFF] php image processing
Date: Mon, 13 Sep 2004 10:57:02 +0400
Message-ID: <414544BE.3040505@ricom.ru> (raw)

Привет,
Прошу прощения за немного оффтопик, но первый раз столкнулся с 
проблемой в php у которй непонятно от куда ноги произрастают:

Требуется загрузить файл (png) и вывести его через <img src"...
Так вот когда что у меня получается:

$png=loadpng("/images/s_graph.png");
$rgb=imagecolorat($png,1,1);
if ($rgb == 0) {
   imagepng($png);
   imagedestroy($png);
   exit(0);
}

function loadpng($filename)
{
    if (imagetypes() & IMG_PNG) {
       header("content-type: image/png");
       $im=@imagecreatefrompng($filename);
       if (!$png) {
          $im=@imagecreate(350,30);
          $bg=imagecolorallocate($im,255,255,255);
          $tc=imagecolorallocate($im,0,0,0);
          imagefilledrectangle($im,0,0,350,30,$bg);
          imagestring($im, 2,5,6,"Error loading image $filename", 
$tc);
       }
    } else {
       print "This PHP server dosn't support <b>PNG</b> 
format<br>\n";
       exit(1);
    }
    return $im;
}

Так вот - файл s_graph.png лежит в указанном каталоге (пробовал в 
разные и корни класть - эффект тот же) - там мне на страницу 
всегда выдается что "Error loading image" - с правами вроде все 
окей (сам то файл открывается если его просто прописать в <img 
src>.... Создать с нуля png тоде получается, а вот загрузить 
готовый никак? В чем может быть проблема или хотя бы куда копать?


-- 
Всего наилучшего,
Системный Администратор ЗАО "ИК "РИКОМ-ТРАСТ"
Алексей Морсов
ICQ: 196766290
Jabber: Samurai@jabber.ru
http://www.ricom.ru
http://www.fondmarket.ru


             reply	other threads:[~2004-09-13  6:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-13  6:57 Alexey Morsov [this message]
2004-09-13  7:49 ` Alexey Morsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=414544BE.3040505@ricom.ru \
    --to=samurai@ricom.ru \
    --cc=community@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git