List Info

Thread: Re: Re: Image Watermarking with PHP




Re: Re: Image Watermarking with PHP
country flaguser name
United States
2008-03-24 08:29:34

--- Wade Smart < wade%40wadesmart.com">wadewadesmart.com> wrote:

> Going through the forums on several sites Im not the only one having
> this problem. And its still confusing as some say that the second
> parameter is a file name and some say its a destination. And it seems to
> work either way for many - which I dont understand that at all.
>;
> I simplified this out to just:
&gt; $saveTo = "new_picts/";
> $saveAs = "NewFile.png&quot;
>
> and tried
&gt; imagepng($img_handle, $saveTo) and imagepng($img_handle. $saveAs);
> and neither work. Adding in the third and four parmeter as several posts
> say you must have, I added 0, NULL but that didnt help either.
>
> As for right now, only imagepng($img_handle); seems to work.
&gt;
> Wade

Note that the documentation (http://php.net/imagepng) indicates that you can
output an image OR save an image. The same function call cannot do both. You
will have to call it twice -- once to save and once to output the image to the
browser.

The second parameter for saving the image is expecting a path and filename (eg
&quot;thumbs/mypic.png&quot; or /var/www/user/thumbs/mypic.png"). Probably the relative
path (first example) is best since it allows some flexibility and should keep
it working even if your host moves things around for your account.

The directory where the images will be saved must be writable by the web
server. With Apache on Linux this may be the user named "apache" or "nobody"
or something else.

*** Having a writable directory in the web space can be very dangerous because
it allows an outside user an opportunity to put content on your server and run
it ***

With that in mind, you may want your writable directory to be outside of your
web space. On my host, for example, my "home" directory has a public_html
directory which contains all of the files that can be accessed by Apache's
configuration. Other files and directories at the home directory level cannot
be reached by Apache (by configuration) but can be accessed by PHP functions if
given a proper path.

Check with your sysadmins about setting permissions and creating such a
directory. You will need to have a PHP handler script which can obtain these
files in a controlled (ie authorized and safe) manner.

More than likely, the reason why your function does not seem to work when you
add a second parameter is that if you give a filename only, the directory where
your PHP script is running is not (and should not be) writable by Apache. You
don't see the error message because the browser has received the image/png MIME
type and is expecting binary image data. This is where sending errors to a log
file can be very helpful.

James

__._,_.___
.

__,_._,___
Strict Standards: strtotime()
country flaguser name
United States
2008-03-24 10:13:54

i'm getting this error in my PHP can someone help me in getting rid of
it :? thanks

Strict Standards: strtotime() [function.strtotime]: It is not safe to
rely on the system's timezone settings. Please use the date.timezone
setting, the TZ environment variable or the date_default_timezone_set()
function. In case you used any of those methods and you are still
getting this warning, you most likely misspelled the timezone
identifier. We selected 'America/Chicago' for '-6.0/no DST' instead in
c:Inetpubwwwrootphpmyadmintbl_properties_structure.php on line 665

Strict Standards: strftime() [function.strftime]: It is not safe to rely
on the system's timezone settings. Please use the date.timezone setting,
the TZ environment variable or the date_default_timezone_set() function.
In case you used any of those methods and you are still getting this
warning, you most likely misspelled the timezone identifier. We selected
'America/Chicago' for '-6.0/no DST' instead in
c:Inetpubwwwrootphpmyadminlibrariescommon.lib.php on line 1761

Strict Standards: strftime() [function.strftime]: It is not safe to rely
on the system's timezone settings. Please use the date.timezone setting,
the TZ environment variable or the date_default_timezone_set() function.
In case you used any of those methods and you are still getting this
warning, you most likely misspelled the timezone identifier. We selected
'America/Chicago' for '-6.0/no DST' instead in
c:Inetpubwwwrootphpmyadminlibrariescommon.lib.php on line 1762

Strict Standards: strftime() [function.strftime]: It is not safe to rely
on the system's timezone settings. Please use the date.timezone setting,
the TZ environment variable or the date_default_timezone_set() function.
In case you used any of those methods and you are still getting this
warning, you most likely misspelled the timezone identifier. We selected
'America/Chicago' for '-6.0/no DST' instead in
c:Inetpubwwwrootphpmyadminlibrariescommon.lib.php on line 1764
Mar 24, 2008 at 07:05 AM

__._,_.___
.

__,_._,___
inventory PHP
country flaguser name
United States
2008-03-26 10:55:13

is there any good inventory PHP examples anywhere >? thanks

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
Re: inventory PHP
country flaguser name
United States
2008-03-27 11:44:41

Brian E Boothe wrote:
&gt;
>
> is there any good inventory PHP examples anywhere >? thanks
&gt;

I assume you are referring to an inventory software.
Try this one: http://www.nolapro.com/index-5.html
It's open source & well supported.

bp

__._,_.___
.

__,_._,___
[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )