php-windows Digest 10 Sep 2013 15:20:32 -0000 Issue 4151

Topics (messages 31167 through 31174):

Re: PHP & Samba
        31167 by: Pierre Joye

Re: GD imagerectangle() function - background transparency?
        31168 by: Jacob Kruger
        31169 by: Jacob Kruger
        31170 by: Pierre Joye
        31171 by: Jacob Kruger
        31172 by: Pierre Joye
        31173 by: Jacob Kruger

Re: WinCache 1.3.5 release on SourceForge
        31174 by: Bruno CHALOPIN

Administrivia:

To subscribe to the digest, e-mail:
        php-windows-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-windows-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-wind...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
hi

On Thu, Sep 5, 2013 at 4:46 PM, Jorge F. Hernandez <jfh...@gmail.com> wrote:
> Hey guys,
>
> Does anybody know a way to browse a Samba (smb) server using PHP?

Network paths work just fine with any file functions. If you need
special authentication like domain auth under a different users, then
there are many classes out there providing this feature.

And as Anatol suggested, if you need to always access the same network
path, mounting it may provide additional benefits as well.


-- 
Pierre

@pierrejoye | http://www.libgd.org

--- End Message ---
--- Begin Message --- Effectively, I've got sort of template images, and want to sort of draw multiple outline boxes onto them where users can then choose one to then insert text onto image - almost like a form of eCard template rendition, but, bit different.

I was originally trying to show the boxes/areas to the user using relatively positioned template images, overlaid by absolutely positioned div elements, with coloured borders, handled using CSS, and then jQuery to manipulate the highlighted/chosen one by changing it's border-color CSS attribute, client-side/at runtime, but, this doesn't always seem to cooperate/implement it at run time.

Have now told them will try sort of dynamically generating a version of the template image, server-side, with the various area outlines drawn onto it, which can then reload at run-time when a new text outline area is selected, but initially tried creating an image resource from the template file, and then using imagerectangle to draw a rectangle onto it, after allocating the relevant colour, and setting drawing thickness, but, it seemed to be blanking out the template image, so I then tried creating a new image resource of the same dimensions, filling it up with an obscure colour, draw the rectangle onto it, set it's transparency to the obscure colour, and then use either imagecopy() or imagecopymerge() to copy it over the original template image, but, still seems to be just blocking out the actual template image.

Now, suppose will maybe also try out splitting the blocks to be drawn up into actual lines, and just try drawing the lines onto the original template image, and see if that works, since at the moment, apparently the combination output image is just a white background, with the coloured boxes on it - as in, it's again just blocked out the original image, as opposed to actually overlaying a somewhat transparent image onto it, and suppose this could be due to pallett's not matching, or something..?

Anyway, let me quickly slap together a couple of tests, and will try post a link, and source code, etc.

Thanks

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

----- Original Message ----- From: "Pierre Joye" <pierre....@gmail.com>
To: "Jacob Kruger" <ja...@blindza.co.za>
Cc: "php-windows" <php-wind...@lists.php.net>
Sent: Friday, September 06, 2013 7:59 AM
Subject: Re: [PHP-WIN] GD imagerectangle() function - background transparency?


hi!

On Thu, Sep 5, 2013 at 10:35 PM, Jacob Kruger <ja...@blindza.co.za> wrote:
Just wondering, if I load an existing image into an image resource, and then draw a rectangle on it using the GD imagerectangle() function, and specifically not using the imagefilledrectangle() function, does the new rectangle/box overlay the existing image content, or just draw the outlines thereof onto/overlaying the existing content?

Alternatively, should I load the existing image, then use something like imagecreatetruecolor() to create another image resource of the same dimensions, fill it with an obscure colour, draw the rectangle on it, set the transparency colour for that specific image resource to the obscure colour, and then copy it over the original/existing image resource before outputting/returning the combination?

imagecopy supports alpha, imageoverlay lets you define the mode. But
I'm not sure what kind of results you try to achieve, please put a
link to an example result image with the two source images, it could
help :)

--
Pierre

@pierrejoye | http://www.libgd.org


--- End Message ---
--- Begin Message ---
Ok, here's the test code - the drawBox() function is the current
application/implementation am now trying out:

<?php
function drawBox($img, $arCoords, $iColour, $iThickness=2) {
imagesetthickness($img, $iThickness);
$xLeft = intval($arCoords[0]);
$yTop = intval($arCoords[1]);
$xRight = intval($arCoords[2]);
$yBottom = intval($arCoords[3]);
imageline($img, $xLeft, $yTop, $xRight, $yTop, $iColour);
imageline($img, $xLeft, $yTop, $xLeft, $yBottom, $iColour);
imageline($img, $xRight, $yTop, $xRight, $yBottom, $iColour);
imageline($img, $xLeft, $yBottom, $xRight, $yBottom, $iColour);
return $img;
}//end of drawBox function

$imgOut = imagecreatefrompng("./images/test.png");
$colourYellow = imagecolorallocate($imgOut, 255, 255, 0);
$arBoxCoords = array(50, 50, 150, 150);
$imgOut = drawBox($imgOut, $arBoxCoords, $colourYellow, 2);
header("Content-Disposition: inline; filename=\"test.png\"");
header("Content-Type: image/png");
imagepng($imgOut);
imagedestroy($imgOut);
exit;
?>

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

----- Original Message ----- From: "Jacob Kruger" <ja...@blindza.co.za>
To: <php-wind...@lists.php.net>
Cc: "Pierre Joye" <pierre....@gmail.com>
Sent: Friday, September 06, 2013 8:39 AM
Subject: Re: [PHP-WIN] GD imagerectangle() function - background
transparency?


Effectively, I've got sort of template images, and want to sort of draw
multiple outline boxes onto them where users can then choose one to then
insert text onto image - almost like a form of eCard template rendition,
but, bit different.

I was originally trying to show the boxes/areas to the user using
relatively positioned template images, overlaid by absolutely positioned
div elements, with coloured borders, handled using CSS, and then jQuery to
manipulate the highlighted/chosen one by changing it's border-color CSS
attribute, client-side/at runtime, but, this doesn't always seem to
cooperate/implement it at run time.

Have now told them will try sort of dynamically generating a version of
the template image, server-side, with the various area outlines drawn onto
it, which can then reload at run-time when a new text outline area is
selected, but initially tried creating an image resource from the template
file, and then using imagerectangle to draw a rectangle onto it, after
allocating the relevant colour, and setting drawing thickness, but, it
seemed to be blanking out the template image, so I then tried creating a
new image resource of the same dimensions, filling it up with an obscure
colour, draw the rectangle onto it, set it's transparency to the obscure
colour, and then use either imagecopy() or imagecopymerge() to copy it
over the original template image, but, still seems to be just blocking out
the actual template image.

Now, suppose will maybe also try out splitting the blocks to be drawn up
into actual lines, and just try drawing the lines onto the original
template image, and see if that works, since at the moment, apparently the
combination output image is just a white background, with the coloured
boxes on it - as in, it's again just blocked out the original image, as
opposed to actually overlaying a somewhat transparent image onto it, and
suppose this could be due to pallett's not matching, or something..?

Anyway, let me quickly slap together a couple of tests, and will try post
a link, and source code, etc.

Thanks

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

----- Original Message ----- From: "Pierre Joye" <pierre....@gmail.com>
To: "Jacob Kruger" <ja...@blindza.co.za>
Cc: "php-windows" <php-wind...@lists.php.net>
Sent: Friday, September 06, 2013 7:59 AM
Subject: Re: [PHP-WIN] GD imagerectangle() function - background
transparency?


hi!

On Thu, Sep 5, 2013 at 10:35 PM, Jacob Kruger <ja...@blindza.co.za> wrote:
Just wondering, if I load an existing image into an image resource, and
then draw a rectangle on it using the GD imagerectangle() function, and
specifically not using the imagefilledrectangle() function, does the new
rectangle/box overlay the existing image content, or just draw the
outlines thereof onto/overlaying the existing content?

Alternatively, should I load the existing image, then use something like
imagecreatetruecolor() to create another image resource of the same
dimensions, fill it with an obscure colour, draw the rectangle on it, set
the transparency colour for that specific image resource to the obscure
colour, and then copy it over the original/existing image resource before
outputting/returning the combination?

imagecopy supports alpha, imageoverlay lets you define the mode. But
I'm not sure what kind of results you try to achieve, please put a
link to an example result image with the two source images, it could
help :)

--
Pierre

@pierrejoye | http://www.libgd.org


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--- End Message ---
--- Begin Message ---
thanks, but I was asking for the source image(s) and the resulting
image (use gimp or whatever to show what you would like to achieve),
easier to actually see what you want to do :)

About transparency, see imagealphablending and imagesavealpha

On Fri, Sep 6, 2013 at 9:39 AM, Jacob Kruger <ja...@blindza.co.za> wrote:
> Ok, here's the test code - the drawBox() function is the current
> application/implementation am now trying out:
>
> <?php
> function drawBox($img, $arCoords, $iColour, $iThickness=2) {
> imagesetthickness($img, $iThickness);
> $xLeft = intval($arCoords[0]);
> $yTop = intval($arCoords[1]);
> $xRight = intval($arCoords[2]);
> $yBottom = intval($arCoords[3]);
> imageline($img, $xLeft, $yTop, $xRight, $yTop, $iColour);
> imageline($img, $xLeft, $yTop, $xLeft, $yBottom, $iColour);
> imageline($img, $xRight, $yTop, $xRight, $yBottom, $iColour);
> imageline($img, $xLeft, $yBottom, $xRight, $yBottom, $iColour);
> return $img;
> }//end of drawBox function
>
> $imgOut = imagecreatefrompng("./images/test.png");
> $colourYellow = imagecolorallocate($imgOut, 255, 255, 0);
> $arBoxCoords = array(50, 50, 150, 150);
> $imgOut = drawBox($imgOut, $arBoxCoords, $colourYellow, 2);
> header("Content-Disposition: inline; filename=\"test.png\"");
> header("Content-Type: image/png");
> imagepng($imgOut);
> imagedestroy($imgOut);
> exit;
> ?>
>
>
> Jacob Kruger
> Blind Biker
> Skype: BlindZA
> '...fate had broken his body, but not his spirit...'
>
> ----- Original Message ----- From: "Jacob Kruger" <ja...@blindza.co.za>
> To: <php-wind...@lists.php.net>
> Cc: "Pierre Joye" <pierre....@gmail.com>
> Sent: Friday, September 06, 2013 8:39 AM
>
> Subject: Re: [PHP-WIN] GD imagerectangle() function - background
> transparency?
>
>
>> Effectively, I've got sort of template images, and want to sort of draw
>> multiple outline boxes onto them where users can then choose one to then
>> insert text onto image - almost like a form of eCard template rendition,
>> but, bit different.
>>
>> I was originally trying to show the boxes/areas to the user using
>> relatively positioned template images, overlaid by absolutely positioned
>> div elements, with coloured borders, handled using CSS, and then jQuery to
>> manipulate the highlighted/chosen one by changing it's border-color CSS
>> attribute, client-side/at runtime, but, this doesn't always seem to
>> cooperate/implement it at run time.
>>
>> Have now told them will try sort of dynamically generating a version of
>> the template image, server-side, with the various area outlines drawn onto
>> it, which can then reload at run-time when a new text outline area is
>> selected, but initially tried creating an image resource from the template
>> file, and then using imagerectangle to draw a rectangle onto it, after
>> allocating the relevant colour, and setting drawing thickness, but, it
>> seemed to be blanking out the template image, so I then tried creating a
>> new image resource of the same dimensions, filling it up with an obscure
>> colour, draw the rectangle onto it, set it's transparency to the obscure
>> colour, and then use either imagecopy() or imagecopymerge() to copy it
>> over the original template image, but, still seems to be just blocking out
>> the actual template image.
>>
>> Now, suppose will maybe also try out splitting the blocks to be drawn up
>> into actual lines, and just try drawing the lines onto the original
>> template image, and see if that works, since at the moment, apparently the
>> combination output image is just a white background, with the coloured
>> boxes on it - as in, it's again just blocked out the original image, as
>> opposed to actually overlaying a somewhat transparent image onto it, and
>> suppose this could be due to pallett's not matching, or something..?
>>
>> Anyway, let me quickly slap together a couple of tests, and will try post
>> a link, and source code, etc.
>>
>> Thanks
>>
>> Jacob Kruger
>> Blind Biker
>> Skype: BlindZA
>> '...fate had broken his body, but not his spirit...'
>>
>> ----- Original Message ----- From: "Pierre Joye" <pierre....@gmail.com>
>> To: "Jacob Kruger" <ja...@blindza.co.za>
>> Cc: "php-windows" <php-wind...@lists.php.net>
>> Sent: Friday, September 06, 2013 7:59 AM
>> Subject: Re: [PHP-WIN] GD imagerectangle() function - background
>> transparency?
>>
>>
>> hi!
>>
>> On Thu, Sep 5, 2013 at 10:35 PM, Jacob Kruger <ja...@blindza.co.za> wrote:
>>>
>>> Just wondering, if I load an existing image into an image resource, and
>>> then draw a rectangle on it using the GD imagerectangle() function, and
>>> specifically not using the imagefilledrectangle() function, does the new
>>> rectangle/box overlay the existing image content, or just draw the
>>> outlines thereof onto/overlaying the existing content?
>>>
>>> Alternatively, should I load the existing image, then use something like
>>> imagecreatetruecolor() to create another image resource of the same
>>> dimensions, fill it with an obscure colour, draw the rectangle on it, set
>>> the transparency colour for that specific image resource to the obscure
>>> colour, and then copy it over the original/existing image resource before
>>> outputting/returning the combination?
>>
>>
>> imagecopy supports alpha, imageoverlay lets you define the mode. But
>> I'm not sure what kind of results you try to achieve, please put a
>> link to an example result image with the two source images, it could
>> help :)
>>
>> --
>> Pierre
>>
>> @pierrejoye | http://www.libgd.org
>>
>>
>> --
>> PHP Windows Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org

--- End Message ---
--- Begin Message --- Well, here's one of the test images - literally just a test image I took of a pseudo-toy a while ago:
https://dl.dropboxusercontent.com/u/13327195/13771158254.png

And, here's the current output/finished off version:
https://dl.dropboxusercontent.com/u/13327195/14watermarked.png

The two areas that should have had boxes drawn for them are:
And, the coordinates of the two test/text areas/box outlines are (x-y*x-y):
10-10*200-50
50-50*500-80

Thanks

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

----- Original Message ----- From: "Pierre Joye" <pierre....@gmail.com>
To: "Jacob Kruger" <ja...@blindza.co.za>
Cc: "php-windows" <php-wind...@lists.php.net>
Sent: Friday, September 06, 2013 10:45 AM
Subject: Re: [PHP-WIN] GD imagerectangle() function - background transparency?


thanks, but I was asking for the source image(s) and the resulting
image (use gimp or whatever to show what you would like to achieve),
easier to actually see what you want to do :)

About transparency, see imagealphablending and imagesavealpha

On Fri, Sep 6, 2013 at 9:39 AM, Jacob Kruger <ja...@blindza.co.za> wrote:
Ok, here's the test code - the drawBox() function is the current
application/implementation am now trying out:

<?php
function drawBox($img, $arCoords, $iColour, $iThickness=2) {
imagesetthickness($img, $iThickness);
$xLeft = intval($arCoords[0]);
$yTop = intval($arCoords[1]);
$xRight = intval($arCoords[2]);
$yBottom = intval($arCoords[3]);
imageline($img, $xLeft, $yTop, $xRight, $yTop, $iColour);
imageline($img, $xLeft, $yTop, $xLeft, $yBottom, $iColour);
imageline($img, $xRight, $yTop, $xRight, $yBottom, $iColour);
imageline($img, $xLeft, $yBottom, $xRight, $yBottom, $iColour);
return $img;
}//end of drawBox function

$imgOut = imagecreatefrompng("./images/test.png");
$colourYellow = imagecolorallocate($imgOut, 255, 255, 0);
$arBoxCoords = array(50, 50, 150, 150);
$imgOut = drawBox($imgOut, $arBoxCoords, $colourYellow, 2);
header("Content-Disposition: inline; filename=\"test.png\"");
header("Content-Type: image/png");
imagepng($imgOut);
imagedestroy($imgOut);
exit;
?>


Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

----- Original Message ----- From: "Jacob Kruger" <ja...@blindza.co.za>
To: <php-wind...@lists.php.net>
Cc: "Pierre Joye" <pierre....@gmail.com>
Sent: Friday, September 06, 2013 8:39 AM

Subject: Re: [PHP-WIN] GD imagerectangle() function - background
transparency?


Effectively, I've got sort of template images, and want to sort of draw
multiple outline boxes onto them where users can then choose one to then
insert text onto image - almost like a form of eCard template rendition,
but, bit different.

I was originally trying to show the boxes/areas to the user using
relatively positioned template images, overlaid by absolutely positioned
div elements, with coloured borders, handled using CSS, and then jQuery to
manipulate the highlighted/chosen one by changing it's border-color CSS
attribute, client-side/at runtime, but, this doesn't always seem to
cooperate/implement it at run time.

Have now told them will try sort of dynamically generating a version of
the template image, server-side, with the various area outlines drawn onto
it, which can then reload at run-time when a new text outline area is
selected, but initially tried creating an image resource from the template
file, and then using imagerectangle to draw a rectangle onto it, after
allocating the relevant colour, and setting drawing thickness, but, it
seemed to be blanking out the template image, so I then tried creating a
new image resource of the same dimensions, filling it up with an obscure
colour, draw the rectangle onto it, set it's transparency to the obscure
colour, and then use either imagecopy() or imagecopymerge() to copy it
over the original template image, but, still seems to be just blocking out
the actual template image.

Now, suppose will maybe also try out splitting the blocks to be drawn up
into actual lines, and just try drawing the lines onto the original
template image, and see if that works, since at the moment, apparently the
combination output image is just a white background, with the coloured
boxes on it - as in, it's again just blocked out the original image, as
opposed to actually overlaying a somewhat transparent image onto it, and
suppose this could be due to pallett's not matching, or something..?

Anyway, let me quickly slap together a couple of tests, and will try post
a link, and source code, etc.

Thanks

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

----- Original Message ----- From: "Pierre Joye" <pierre....@gmail.com>
To: "Jacob Kruger" <ja...@blindza.co.za>
Cc: "php-windows" <php-wind...@lists.php.net>
Sent: Friday, September 06, 2013 7:59 AM
Subject: Re: [PHP-WIN] GD imagerectangle() function - background
transparency?


hi!

On Thu, Sep 5, 2013 at 10:35 PM, Jacob Kruger <ja...@blindza.co.za> wrote:

Just wondering, if I load an existing image into an image resource, and
then draw a rectangle on it using the GD imagerectangle() function, and
specifically not using the imagefilledrectangle() function, does the new
rectangle/box overlay the existing image content, or just draw the
outlines thereof onto/overlaying the existing content?

Alternatively, should I load the existing image, then use something like
imagecreatetruecolor() to create another image resource of the same
dimensions, fill it with an obscure colour, draw the rectangle on it, set
the transparency colour for that specific image resource to the obscure
colour, and then copy it over the original/existing image resource before
outputting/returning the combination?


imagecopy supports alpha, imageoverlay lets you define the mode. But
I'm not sure what kind of results you try to achieve, please put a
link to an example result image with the two source images, it could
help :)

--
Pierre

@pierrejoye | http://www.libgd.org


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org



--- End Message ---
--- Begin Message ---
On Fri, Sep 6, 2013 at 11:13 AM, Jacob Kruger <ja...@blindza.co.za> wrote:
> Well, here's one of the test images - literally just a test image I took of
> a pseudo-toy a while ago:
> https://dl.dropboxusercontent.com/u/13327195/13771158254.png
>
> And, here's the current output/finished off version:
> https://dl.dropboxusercontent.com/u/13327195/14watermarked.png
>
> The two areas that should have had boxes drawn for them are:
> And, the coordinates of the two test/text areas/box outlines are (x-y*x-y):
> 10-10*200-50
> 50-50*500-80

Do you want to simply draw boxes there? Or copy existing images at
these locations? Using some transparency? like a watermark?
-- 
Pierre

@pierrejoye | http://www.libgd.org

--- End Message ---
--- Begin Message --- For now, just draw boxes there, since already have the watermarking sorted out - think so anyway, and in terms of copying other images, this drawing of boxes is to let users choose specific locations/areas to then insert other images and text, but, think already got that part of it sorted - don't know why this is suddenly, again, seeming to corrupt the output image resource somehow.

Stay well

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

----- Original Message ----- From: "Pierre Joye" <pierre....@gmail.com>
To: "Jacob Kruger" <ja...@blindza.co.za>
Cc: "php-windows" <php-wind...@lists.php.net>
Sent: Friday, September 06, 2013 12:54 PM
Subject: Re: [PHP-WIN] GD imagerectangle() function - background transparency?


On Fri, Sep 6, 2013 at 11:13 AM, Jacob Kruger <ja...@blindza.co.za> wrote:
Well, here's one of the test images - literally just a test image I took of
a pseudo-toy a while ago:
https://dl.dropboxusercontent.com/u/13327195/13771158254.png

And, here's the current output/finished off version:
https://dl.dropboxusercontent.com/u/13327195/14watermarked.png

The two areas that should have had boxes drawn for them are:
And, the coordinates of the two test/text areas/box outlines are (x-y*x-y):
10-10*200-50
50-50*500-80

Do you want to simply draw boxes there? Or copy existing images at
these locations? Using some transparency? like a watermark?
--
Pierre

@pierrejoye | http://www.libgd.org



--- End Message ---
--- Begin Message ---
Le Fri, 23 Aug 2013 09:01:55 +0200, Pierre Joye a écrit :

> In the long run yes, or maybe. Right now the last release is totally
> unusable. For various reasons, some fixable and other will be hardly
> fixable without changes in the engine
> 
> ... Also windows as a whole is not a priority for Zend, for
> quite some time ...

Zend provide Zend Server for windows from quite some time now. And 
OpCache was made from Zend Optimizer + wich is embeded in Zend Server.

I don't really see why it's unusable on windows (perhaps a php 5.5 
problem though).

Regards,

Bruno

--- End Message ---

Reply via email to