php-general Digest 8 May 2006 17:05:31 -0000 Issue 4116
Topics (messages 235700 through 235726):
Browser displays blank page, while request still being handled
235700 by: Rolf Wouters
235701 by: Rolf Wouters
235702 by: Chris
235703 by: Chris
235704 by: Rolf Wouters
235705 by: Barry
235706 by: Chris
235710 by: Rolf Wouters
235716 by: Chris
235719 by: Rolf Wouters
235720 by: Rolf Wouters
235724 by: Wolf
Re: Passing an indefinite number of parameters by reference
235707 by: Chris Jenkinson
235708 by: Chris Jenkinson
235709 by: Chris Jenkinson
235711 by: Stut
235712 by: Stut
blowfish result varies local > server
235713 by: D_C
235714 by: Barry
235725 by: Eric Butera
235726 by: Richard Lynch
Scheduling applications
235715 by: Jay Blanchard
235717 by: Jay Blanchard
Re: Convert from jpg to gif ... change dpi...
235718 by: tedd
235721 by: tg-php.gryffyndevelopment.com
Configuring the error suppression
235722 by: John Meyer
235723 by: Eric Butera
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
Hello everybody
I'm having some strange behaviour in a PHP4 app I'm working on.
When I send my request to the server, it returns a blank page to me
within ca. 40 sec. On the server itself, my request is still being handled.
The script behind the request does the following:
- delete some files
- copy files from dir A to dir B
- read some data from a database and generates some XML-files
(i.e. a basic "publish" procedure)
The problem isn't the script itself, nor the server. I know this,
because the same code is being used on the same server for other
instances of this application.
The only difference between the problem-app and the other apps is that
the problem app has:
A) a lot more files needing to be copied (number of files and size)
B) a lot more (stale) records in the DB
Another strange thing is, that when I try to view the source code of the
blank page, my browser asks me if I want to send the request again :-(
I've been searching the Web for a long time now, and I'm really
desperate for some answers. If anyone could help me, even a hint of
where to start, it would be greatly appreciated.
With kind regards and many, many thanks in advance
Rolf Wouters
--- End Message ---
--- Begin Message ---
Chris wrote:
Rolf Wouters wrote:
Hello everybody
I'm having some strange behaviour in a PHP4 app I'm working on.
When I send my request to the server, it returns a blank page to me
within ca. 40 sec. On the server itself, my request is still being
handled.
What exactly do you want help with? The blank page or the request
still going?
The blank page. It shouldn't be there, and not when the request is
still running. Or am I mistaken in thinking that the browser should
wait with displaying _anything_ before it becomes the result-page from
the server.
Is the problem server running a fast-cgi server of some sort (eg
lighttpd) and the other servers running apache?
The server is running apache, and there are no other servers. All these
similar apps I was talking about, run on the same server with identical
configurations.
--- End Message ---
--- Begin Message ---
Rolf Wouters wrote:
Hello everybody
I'm having some strange behaviour in a PHP4 app I'm working on.
When I send my request to the server, it returns a blank page to me
within ca. 40 sec. On the server itself, my request is still being
handled.
What exactly do you want help with? The blank page or the request still
going?
Is the problem server running a fast-cgi server of some sort (eg
lighttpd) and the other servers running apache?
--
Postgresql & php tutorials
http://www.designmagick.com/
--- End Message ---
--- Begin Message ---
Rolf Wouters wrote:
Chris wrote:
Rolf Wouters wrote:
Hello everybody
I'm having some strange behaviour in a PHP4 app I'm working on.
When I send my request to the server, it returns a blank page to me
within ca. 40 sec. On the server itself, my request is still being
handled.
What exactly do you want help with? The blank page or the request
still going?
The blank page. It shouldn't be there, and not when the request is
still running. Or am I mistaken in thinking that the browser should
wait with displaying _anything_ before it becomes the result-page from
the server.
I'm guessing it's just a timeout issue - "maximum execution time
exceeded" type thing - check your php or apache error logs and see what
that tells you.. if nothing shows up, turn log_errors on, restart apache
and see what you get.
Try adding some flush() calls to the script. That might get the browser
to display some content.. Don't know whether it will work though.
Copy has to wait until it's finished before telling you the results. If
it's copying a 20M file, that takes a while.. If you're copying multiple
20M files, then hey.. there's you're problem. How many and how big are
the files in this case?
You might be better off running a script to run through cron every 5
minutes or so and doing it all for you.. then getting it to email you
the results.
--
Postgresql & php tutorials
http://www.designmagick.com/
--- End Message ---
--- Begin Message ---
Chris wrote:
Rolf Wouters wrote:
Chris wrote:
Rolf Wouters wrote:
Hello everybody
I'm having some strange behaviour in a PHP4 app I'm working on.
When I send my request to the server, it returns a blank page to me
within ca. 40 sec. On the server itself, my request is still being
handled.
What exactly do you want help with? The blank page or the request
still going?
The blank page. It shouldn't be there, and not when the request is
still running. Or am I mistaken in thinking that the browser should
wait with displaying _anything_ before it becomes the result-page
from the server.
I'm guessing it's just a timeout issue - "maximum execution time
exceeded" type thing - check your php or apache error logs and see
what that tells you.. if nothing shows up, turn log_errors on, restart
apache and see what you get.
I don't think it's a timeout issue on the server-side, because I've
already tried setting MAX_EXECUTION_TIME and MAX_INPUT_TIME to extremly
high values, and got the same result (i.e. the blank page).
By setting them to extremly low values I was able to verify the
app/script/server 's behaviour when it did timeout, and that produced
the expected warning-message for MAX_EXECUTION_TIME exceeded.
I couldn't find anything in the logs, although log_errors is turned on,
and the logging levels set to log everything thats possible.
Try adding some flush() calls to the script. That might get the
browser to display some content.. Don't know whether it will work though.
That's something I haven't tried yet, so thanks for the tip.
Copy has to wait until it's finished before telling you the results.
If it's copying a 20M file, that takes a while.. If you're copying
multiple 20M files, then hey.. there's you're problem. How many and
how big are the files in this case?
We're talking about multiple copy operations. The first one copies 230
files (approx. 40mb) and the second one copies about 2200 files
(195mb). Most files are under 400kb a piece.
The request shouldn't generate any output untill it is completely
finished. In between different operations, all message are stored in a
string-variable. At the end of the publish-request, another request
(show_result) is called, and the result-string is placed into $_REQUEST,
like this:
$_REQUEST["result"] = &$result;
You might be better off running a script to run through cron every 5
minutes or so and doing it all for you.. then getting it to email you
the results.
Running the script through cron wouldn't be a good idea. The app we're
talking about is a kind of Content Management System for photographers,
so the publish-request should only be called when the user has finished
his modifications to the site and is ready to publish them to his website.
--- End Message ---
--- Begin Message ---
Rolf Wouters schrieb:
Try adding some flush() calls to the script. That might get the
browser to display some content.. Don't know whether it will work though.
That's something I haven't tried yet, so thanks for the tip.
You should show some progress bars or smiliar.
Having a blank page for too long might ppl to do an abort and the script
gets f***ed up.
Better is to show some "please wait while copying" or something.
Let him know what you do and probably show it like:
Starting copying:
|:-> OOOOOOOOOO <:-< 100%
Finished Copying.
Starting generating XML stuff please wait:
And so on.
There are some really nasty outputs you can generate while the user has
to wait.
And you wouldn't have a blank page anymore.
Greets
Barry
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)
--- End Message ---
--- Begin Message ---
> I'm guessing it's just a timeout issue - "maximum execution time
> exceeded" type thing - check your php or apache error logs and see
> what that tells you.. if nothing shows up, turn log_errors on, restart
> apache and see what you get.
I don't think it's a timeout issue on the server-side, because I've
already tried setting MAX_EXECUTION_TIME and MAX_INPUT_TIME to extremly
high values, and got the same result (i.e. the blank page).
By setting them to extremly low values I was able to verify the
app/script/server 's behaviour when it did timeout, and that produced
the expected warning-message for MAX_EXECUTION_TIME exceeded.
A browser has a timeout too.. type about:config in firefox, look for
network.http.connect.timeout - timeout is 30 seconds and
network.http.request.timeout is 120 seconds... thats not a long time.
I couldn't find anything in the logs, although log_errors is turned on,
and the logging levels set to log everything thats possible.
>
> Try adding some flush() calls to the script. That might get the
> browser to display some content.. Don't know whether it will work though.
That's something I haven't tried yet, so thanks for the tip.
>
> Copy has to wait until it's finished before telling you the results.
> If it's copying a 20M file, that takes a while.. If you're copying
> multiple 20M files, then hey.. there's you're problem. How many and
> how big are the files in this case?
We're talking about multiple copy operations. The first one copies 230
files (approx. 40mb) and the second one copies about 2200 files
(195mb). Most files are under 400kb a piece.
Time how long it takes you to manually copy that amount of data.
> You might be better off running a script to run through cron every 5
> minutes or so and doing it all for you.. then getting it to email you
> the results.
>
Running the script through cron wouldn't be a good idea. The app we're
talking about is a kind of Content Management System for photographers,
so the publish-request should only be called when the user has finished
his modifications to the site and is ready to publish them to his website.
The request goes in to a "process" queue with the relevant details..
obviously this only gets logged right at the end. Cron job runs, finds
the details, does its work..
If you're trying to do all of this in one step I think you're out of
luck and you might need to break up the processes.
--
Postgresql & php tutorials
http://www.designmagick.com/
--- End Message ---
--- Begin Message ---
> I'm guessing it's just a timeout issue - "maximum execution time
> exceeded" type thing - check your php or apache error logs and see
> what that tells you.. if nothing shows up, turn log_errors on, restart
> apache and see what you get.
I don't think it's a timeout issue on the server-side, because I've
already tried setting MAX_EXECUTION_TIME and MAX_INPUT_TIME to extremly
high values, and got the same result (i.e. the blank page).
By setting them to extremly low values I was able to verify the
app/script/server 's behaviour when it did timeout, and that produced
the expected warning-message for MAX_EXECUTION_TIME exceeded.
A browser has a timeout too.. type about:config in firefox, look for
network.http.connect.timeout - timeout is 30 seconds and
network.http.request.timeout is 120 seconds... thats not a long time.
Browsers indeed have timeouts. But my firefox (v1.5.0.3) didn't have
those settings defined, so I did it for him. But it doesn't seem to
matter what numbers I used (2sec or 2000sec). I still get my blank
page, even when the request hasn't finished yet.
I couldn't find anything in the logs, although log_errors is turned on,
and the logging levels set to log everything thats possible.
>
> Try adding some flush() calls to the script. That might get the
> browser to display some content.. Don't know whether it will work
though.
That's something I haven't tried yet, so thanks for the tip.
>
> Copy has to wait until it's finished before telling you the results.
> If it's copying a 20M file, that takes a while.. If you're copying
> multiple 20M files, then hey.. there's you're problem. How many and
> how big are the files in this case?
We're talking about multiple copy operations. The first one copies 230
files (approx. 40mb) and the second one copies about 2200 files
(195mb). Most files are under 400kb a piece.
Time how long it takes you to manually copy that amount of data.
Tried the flush() calls in between different parts of the request,
doesn't help :-(
Although I don't get why you'd want me to time the copying, I did. In
fact, I timed all operations... Deleting the old files takes about 3
seconds, copying the new data takes about 20 sec, database requests and
generating XML takes another 10 seconds. All in all, the complete
operation takes < 35sec, which should be fast enough to prevent the
browser or server from timing out..
BTW, would a timeout explain why the browser wants to repost the request
when I trie to view the source-code of the blank-page?
> You might be better off running a script to run through cron every 5
> minutes or so and doing it all for you.. then getting it to email you
> the results.
>
Running the script through cron wouldn't be a good idea. The app we're
talking about is a kind of Content Management System for photographers,
so the publish-request should only be called when the user has finished
his modifications to the site and is ready to publish them to his
website.
The request goes in to a "process" queue with the relevant details..
obviously this only gets logged right at the end. Cron job runs, finds
the details, does its work..
Like I explained before, I don't think a cron job can be used, because
the web-site should only be published when the user wants it to.
If you're trying to do all of this in one step I think you're out of
luck and you might need to break up the processes.
What do you mean by breaking up the processes? Put them in different
requests, so that one request calls another one?
--- End Message ---
--- Begin Message ---
>> We're talking about multiple copy operations. The first one copies 230
>> files (approx. 40mb) and the second one copies about 2200 files
>> (195mb). Most files are under 400kb a piece.
>
> Time how long it takes you to manually copy that amount of data.
Tried the flush() calls in between different parts of the request,
doesn't help :-(
Although I don't get why you'd want me to time the copying, I did. In
fact, I timed all operations... Deleting the old files takes about 3
seconds, copying the new data takes about 20 sec, database requests and
generating XML takes another 10 seconds. All in all, the complete
operation takes < 35sec, which should be fast enough to prevent the
browser or server from timing out..
Well, if it took a minute to copy the data, then your disks need
tuning or something and nothing you do in php would affect this.
BTW, would a timeout explain why the browser wants to repost the request
when I trie to view the source-code of the blank-page?
I think that's a firefox thing.. does the same thing happen in IE?
> If you're trying to do all of this in one step I think you're out of
> luck and you might need to break up the processes.
What do you mean by breaking up the processes? Put them in different
requests, so that one request calls another one?
have a "publish site" button that opens a small popup window.
step 1 - prepare the new environment (make dirs, whatever)
(refresh automatically)
step 2 - copy the files
(refresh automatically)
step 3 - create the xml
(refresh automatically)
step 4 ...
use a session variable for example to work out where you are up to and
what to do next.
--
Postgresql & php tutorials
http://www.designmagick.com/
--- End Message ---
--- Begin Message ---
BTW, would a timeout explain why the browser wants to repost the request
when I trie to view the source-code of the blank-page?
I think that's a firefox thing.. does the same thing happen in IE?
Yes, this also happens IE, but IE doesn't show a blank page, instead it
show me a "Page cannot be displayed" error. The only other thing that
IE tells me is that it "Cannot find server or DNS Error". (We've
checked the DNS configuration etc. Everything works fine. Like I said,
we have other incarnations of the same CMS running on the same server.
Only difference between the apps are the number files and DB-records)
Trying to view the source code of this page is, of course, useless,
because the page (and it's source) are created by IE.
--- End Message ---
--- Begin Message ---
One thing I forgot... Thanks for taking the time and helping me out
with this problem, I should have said that a little bit earlier, but I
hope I'm not to late yet :-)
Greetz
Rolf
--- End Message ---
--- Begin Message ---
Break it up into sections and have it output the per/section pieces.
You could do iframes or something so that it all looks like a single
page, or split it up as delete files, upload files, create XML, flush DB
or whatever you are doing. I know it is not pretty, but getting it to
clear up is the point.
I know I used to have an issue with some of that type of stuff, but I
also went in and did an output buffering at the beginning of the script,
ran everything, then output the buffer. That helped me to clear it up.
One of the pieces might be outputting something you just aren't seeing
yet...
HTH,
Wolf
Rolf Wouters wrote:
> Hello everybody
>
<-- SNIP -->
--- End Message ---
--- Begin Message ---
Eric Butera wrote:
One thing you could do is (assuming it's php4)
[...]
This is a bit of a pain though. :)
Unfortunately, changing the functions to use &$params and using
extract() is a significant API change and as such it would be a large
amount of effort.
Chris
--
Chris Jenkinson
[EMAIL PROTECTED]
"Mistrust all in whom the impulse to punish is powerful."
-- Friedrich Nietzsche, Thus Spoke Zarathustra
--- End Message ---
--- Begin Message ---
Tom Rogers wrote:
Here is a cutdown version of a class loader I use, It works for php4 and
php5 and with references. It should be easy to modify.
[...]
Sorry, this does not work with references as func_get_args() copies the
arguments passed, rather than keeping them as references. This means
that the $variable1, $variable2, etc. variables are only references to
the copy made with func_get_args(), rather than to the variables passed
to the first function.
Chris
--
Chris Jenkinson
[EMAIL PROTECTED]
"Mistrust all in whom the impulse to punish is powerful."
-- Friedrich Nietzsche, Thus Spoke Zarathustra
--- End Message ---
--- Begin Message ---
Jochem Maas wrote:
that smells like bad design (but then again you should see some of my
code ;-)
I blame PHP not allowing func_get_args() to use references, rather than
bad design on my part. :)
i can say with confidence 'no, your **** out of luck'.
There must be some clever workaround using global scope variables and
eval(). I just can't think of it yet.
Chris
--
Chris Jenkinson
[EMAIL PROTECTED]
"Mistrust all in whom the impulse to punish is powerful."
-- Friedrich Nietzsche, Thus Spoke Zarathustra
--- End Message ---
--- Begin Message ---
Chris Jenkinson wrote:
Currently I have a function which accepts a limited number of parameters:
call_function($function_name, &$var_1, &$var_2);
I wish to modify the function to accept an indefinite number of
parameters, which may or may not be references.
The function call_function() then calls the function specified in
$function_name, with the variables passed as parameters to that function.
Is this possible? Thanks for any help which can be offered.
Something like this (untested) may work, but someone important once said
that if eval is the answer then you're asking the wrong question...
function call_function($function_name, &$vars)
{
$code = '$retval = '.$function.'(';
$params = array();
foreach (array_keys($vars) as $key)
$params[] = '$var['.$key.']';
$code .= implode(',', $params);
$code .= ');';
return eval($code);
}
For more on eval check the manual: http://php.net/eval, but remember
that it is considerably evil and usually involves some extra security
risk to make sure you're checking and double-checking that nothing
coming from the user gets used unsanitized by eval, and preferably not
at all.
Hope that helps.
-Stut
--- End Message ---
--- Begin Message ---
Oops, returning the wrong thing. Corrected below...
function call_function($function_name, &$vars)
{
$code = '$retval = '.$function.'(';
$params = array();
foreach (array_keys($vars) as $key)
$params[] = '$var['.$key.']';
$code .= implode(',', $params);
$code .= ');';
eval($code);
return $retval;
}
-Stut
--- End Message ---
--- Begin Message ---
hi -
just wondering if anyone knows the answer to this.
i have an item being blowfish encrypted... with the same key, but on
my local and remote machines it gives a different result...
any ideas on this? we're both running simliar (5.x) versions of PHP +
the blowfish is an external (PEAR) library anyway...
very puzzling!
tx,
/dc
--
_______________________________________________
David "DC" Collier
[EMAIL PROTECTED]
skype: callto://d3ntaku
http://www.pikkle.com
+81 (0)80 6521 9559
http://charajam.com 【★キャラ♪ジャム★】
人気キャラとJ-POP最新ヒット曲を自分で組み合わせて
待受Flashや着Flashを作っちゃおう!
_______________________________________________
--- End Message ---
--- Begin Message ---
D_C schrieb:
> hi -
>
> just wondering if anyone knows the answer to this.
>
> i have an item being blowfish encrypted... with the same key, but on
> my local and remote machines it gives a different result...
>
> any ideas on this? we're both running simliar (5.x) versions of PHP +
> the blowfish is an external (PEAR) library anyway...
>
> very puzzling!
>
やほ!
ここはもPEARメールリストがあります。
そこでをといかけますをください;)
じゃね〜♪
Hi!
Here is also a PEAR mailing-list.
You should ask there.
Greets
Barry
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)
--- End Message ---
--- Begin Message ---
On 5/8/06, D_C <[EMAIL PROTECTED]> wrote:
hi -
just wondering if anyone knows the answer to this.
i have an item being blowfish encrypted... with the same key, but on
my local and remote machines it gives a different result...
any ideas on this? we're both running simliar (5.x) versions of PHP +
the blowfish is an external (PEAR) library anyway...
very puzzling!
tx,
/dc
--
_______________________________________________
David "DC" Collier
[EMAIL PROTECTED]
skype: callto://d3ntaku
http://www.pikkle.com
+81 (0)80 6521 9559
http://charajam.com 【★キャラ♪ジャム★】
人気キャラとJ-POP最新ヒット曲を自分で組み合わせて
待受Flashや着Flashを作っちゃおう!
_______________________________________________
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
This isn't really an answer, but I noticed this behavior too when I
was playing around with the PEAR implementation. I didn't read much
into it though because I just switched to using the mcrypt extension.
But that might not be an option for you.
--- End Message ---
--- Begin Message ---
On Mon, May 8, 2006 6:16 am, D_C wrote:
> i have an item being blowfish encrypted... with the same key, but on
> my local and remote machines it gives a different result...
> _______________________________________________
> David "DC" Collier
>
> [EMAIL PROTECTED]
> skype: callto://d3ntaku
> http://www.pikkle.com
> +81 (0)80 6521 9559
>
> http://charajam.com$B!!!Z!z%-%c%i"v%8%c%`!z![(B
> $B?M5$%-%c%i$H(BJ-POP$B:G?7%R%C%H6J$r<+J,$GAH$_9g$o$;$F(B
> $BBT<u(BFlash$B$dCe(BFlash$B$r:n$C$A$c$*$&!*(B
> _______________________________________________
Wild Guesses:
Trailing spaces or even NULL characters may be confusing Blowfish in
some way.
You HAVE confirmed in every way possible that the inputs are the same,
right?...
I often use something like this with "View Source" in browser:
echo "'$input1' (", strlen($input1), ")<hr />";
to be certain that leading/trailing whitepsace isn't messing me up.
And be sure the the key also is the same -- An ASCII FTP transfer that
adds newlines or something can often be masked by modern tools. :-v
--
Like Music?
http://l-i-e.com/artists.htm
--- End Message ---
--- Begin Message ---
I have been searching and reading and testing for days, but I cannot
seem to locate a reliable team scheduling application utilizing PHP and
MySQL. I think that I am searching for the wrong thing search terms wise
as I turn up a lot of project scheduling apps, not people scheduling.
Some of the requirements (not mine, but from a customer service
management person)...
[quote]
1) Collect and disseminate data i.e. rep skill sets level
2) Collect and disseminate data i.e. rep availability, schedule
preferences
3) Collect and disseminate data i.e. rep out of office reasons to help
us manage attendance issues
4) Collect and disseminate workload forecast by half hour
5) Deliver optimum staffing model in spreadsheet format to allow for
manual changes as necessary
6) Allow acceptance of final staffing model and email to all employees
[/quote]
I am sure that I will not locate an app with all of these 'features' but
having it in PHP will allow me to make mods. Any ideas where I can find
something like this? TIA
--- End Message ---
--- Begin Message ---
[snip]
I am sure that I will not locate an app with all of these 'features' but
having it in PHP will allow me to make mods. Any ideas where I can find
something like this? TIA
[/snip]
Aha....the search term needs to be 'time and attendance' ....but still
not a lot out there that I can see so far....suggestions are still very
much appreciated.
--- End Message ---
--- Begin Message ---
At 11:07 PM +0200 5/7/06, Gustav Wiberg wrote:
Hi there!
Is there any way of converting a jpg to gif and change dpi on the fly?
Best regards
Gustav Wiberg
Gustav:
It depends how big the fly is.
But seriously, yes you can change a jpg into a gif by loading it in
as a jpg (imagercreatefromjpeg) and then saving it as a gif
(imagegif).
See: http://www.weberdev.com/imagegif
But, the dpi thing is not meaningful. DPI is how the image is
displayed and not something intrinsic within the image itself. The
image has simply a size (x by y pixels), and how that image is
previewed is outside its purview (I liked that play on words) :-)
If you want to change the image's size, then that can be done via
magecopyresized. But, you cannot change the DPI of an image.
tedd
--
--------------------------------------------------------------------------------
http://sperling.com
--- End Message ---
--- Begin Message ---
Actually I don't believe this is exactly right.... from playing around with
Photoshop you can see that you change an image's resolution under Image ->
Image Size and if you turn off "Resample Image", it will retain the same pixel
dimensions.
GIF's are limited to 72dpi (or ppi if you prefer.. pixel per inch) which
matches what is typically displayable or desirable for web content. But when
you go to print that webpage, you really see the lack of quality in that GIF
image.
If you use a JPG and set it for around 300 dpi/ppi, it prints out a LOT nicer.
So there's a real easy answer to this question... yes, you can change DPI on
the fly when converting JPG -> GIF... the downside is that you're converting to
72dpi whether you like it or not because that's the GIF standard.
If somebody has more or better information on this, I'd love to hear it but
this is how it is as far as I know and have experienced.
-TG
= = = Original message = = =
At 11:07 PM +0200 5/7/06, Gustav Wiberg wrote:
>Hi there!
>
>Is there any way of converting a jpg to gif and change dpi on the fly?
>
>Best regards
>Gustav Wiberg
Gustav:
It depends how big the fly is.
But seriously, yes you can change a jpg into a gif by loading it in
as a jpg (imagercreatefromjpeg) and then saving it as a gif
(imagegif).
See: http://www.weberdev.com/imagegif
But, the dpi thing is not meaningful. DPI is how the image is
displayed and not something intrinsic within the image itself. The
image has simply a size (x by y pixels), and how that image is
previewed is outside its purview (I liked that play on words) :-)
If you want to change the image's size, then that can be done via
magecopyresized. But, you cannot change the DPI of an image.
tedd
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.
--- End Message ---
--- Begin Message ---
Is there anyway to make PHP normally suppress errors, but a piece of
code that would show errors on a particular page?
--- End Message ---
--- Begin Message ---
On 5/8/06, John Meyer <[EMAIL PROTECTED]> wrote:
Is there anyway to make PHP normally suppress errors, but a piece of
code that would show errors on a particular page?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Turn display errors off in your php.ini on production servers, then
you can use...
ini_set('display_errors', true);
...if you must.
A better way is to use the set_error_handler() function to setup your
own custom error handler that will handle errors gracefully. Within
that you can also go a step further and add logging features to let
you know errors. I built an error handler function that emails me on
any errors that my script generates so that once I leave a job I will
know about problems.
I'm not sure what you're trying to do, but letting end users see raw
php erros is a bad idea because it gives out server path information
and other sensitive details that people could potentially exploit.
--- End Message ---