473,394 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Image processing in functions.

I have script (main.php) that calls a secondary script (image.php)
that produces a graphic. The invocation in main.php is like this...

print "<img src=" . chr(34) . "image.php?option=$draw" . chr(34) . ">"

What I would like to do is incoporate all the code contained in
image.php into my main.php as a function. As it currently stands if I
do this, I get an error message saying that the headers already sent.
I've not quite got my head around this- any help would be gratefully
received.

Jul 17 '05 #1
2 1867

"Roger" <fs******@ripnet.jj.ik> wrote in message
news:hm********************************@4ax.com...
I have script (main.php) that calls a secondary script (image.php)
that produces a graphic. The invocation in main.php is like this...

print "<img src=" . chr(34) . "image.php?option=$draw" . chr(34) . ">"

What I would like to do is incoporate all the code contained in
image.php into my main.php as a function. As it currently stands if I
do this, I get an error message saying that the headers already sent.
I've not quite got my head around this- any help would be gratefully
received.


Something in image.php is sending headers (most likely it'll be the
content-type for jpg or png or whatever) and so is main.php - without seeing
the output I can't determine what. If you tweak image.php so it produces a
file on the server but only returns the URL to it, you can link it out and
get all the page output produced by the main.php.

Garp
Jul 17 '05 #2
*** Roger wrote/escribió (Wed, 09 Jun 2004 23:52:46 +0100):
print "<img src=" . chr(34) . "image.php?option=$draw" . chr(34) . ">" What I would like to do is incoporate all the code contained in
image.php into my main.php as a function.
You mean that you want a script that can either output HTML or graphics,
don't you? It should be rather straightforward:

function graphic(){
// Print graphic
}

if($_GET['option']=='WHATEVER'){
graphic();
exit;
}else{
// Print HTML
}
As it currently stands if I do this, I get an error message saying that
the headers already sent. I've not quite got my head around this- any
help would be gratefully received.


You are probably mixing graphics and HTML in one single document.

--
--
-- Álvaro G. Vicario - Burgos, Spain
--
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Jef Driesen | last post by:
I'm implementing some image processing algorithms in C++. I created a class called 'image' (see declaration below), that will take care of the memory allocations and some basic (mathematical)...
5
by: Jigar Mehta | last post by:
Hye Friends!!, Happy New Year!! I am Jigar Mehta from India. Currently I am working on a project in which I need to compress some images on the harddisk... I want to make an engine that reads...
2
by: | last post by:
Hi, we are planning to rewrite an extisting C++ image processing application/library in C#. Now several question arouse where I hope you can help me: So far we allocated a block of memory as...
10
by: stonny | last post by:
Hi, I am converting my matlab program into C/C++. I need to change some image processing toolbox functions into C/C++, such as edge detection, mathematical morphology. Is there any place that I...
1
by: stonny | last post by:
Hi, I am converting my matlab program into C. I need to change some image processing toolbox functions into C, such as edge detection, mathematical morphology. Since I am not very comfortable with...
6
by: RaulAbHK | last post by:
Dear all, I guess this is a basic question with an easy answer but I am a beginner and I would much apreciate your feedbacks. Let's say I have a library with some functionality to perform some...
10
by: Enrique Cruiz | last post by:
Hello all, I am currently implementing a fairly simple algorithm. It scans a grayscale image, and computes a pixel's new value as a function of its original value. Two passes are made, first...
0
by: tavares | last post by:
(Our apologies for cross-posting. We appreciate if you kindly distribute this information by your co- workers and colleagues.) ...
36
by: vimal3271 | last post by:
I want to know how to read image files in C.. what are the headers that i should include? is there any tutorials regarding this ? pls inform me.
1
by: jrhitokiri | last post by:
Hi! I'm working on my undergraduate thesis on the Parallel Image Processing. This deals with optimizing a library my professor gave me and implement MPI (Message Passing Interface) on it (it is in...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.