Re: [PHP] image inventoryer

2012-04-08 Thread Tedd Sperling
Kirk:

Okay, you took the first step. Now please review this:

$filename ");
}
?>

Note:

1. This example does not put in all the embedded formatting shown in your 
example. What you did was simply bad form -- you should learn css as well. 
Also, you don't need to place the code within a bunch of html -- it will work 
"as-is".

2. I always want my students to place images in an image directory -- the above 
conforms to that.

3. The example also shows how to separate the jpg's from other files in the 
directory.


So, where do you want to go now?

Cheers,

tedd


_
tedd.sperl...@gmail.com
http://sperling.com






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



Re: [PHP] image inventoryer

2012-04-08 Thread Kirk Bailey

Thank you!
Not QUITE the first; I have used snippets and small routines for a 
while; however I did not know how to do this in php.


Turns out there are at least 2 methods: glob, and an iteration of 
the directory with readdir() to build up an array, then one by one 
print the elements in the array. In python this is not hard. 
Iteration in python is somewhat different- not to mention getting 
used to do blocks. Being so used to snake charming, learning a new 
way means getting used to different procedures.


On 4/8/2012 2:18 AM, tamouse mailing lists wrote:

On Sat, Apr 7, 2012 at 10:35 PM, Kirk Bailey  wrote:



Image inventory of this directory

body { margin-left: 10; margin-right: 10%; }
body {background-attachment:fixed;}
A:link, A:visited,  A:active { text-decoration:none; }
A:hover { text-decoration:underline; }
.justify{text-align:justify;}
.center{text-align:center;}



This page inventories the contents of this directory and lists all
image files in order- as
the computer determines such matters. Here is the full inventory.


'."\n$filename\n\n";
}
?>



This works nicely. copied code from online manual, chainsaw editing to fit,
superglue in the spare parts needed and it lists them all and composes
proper img links to display on the inventory page. NOW I have the tool i
needed; can someone else put this to good work?

Well, congrats on a first somewhat useful program. All I have to say
now is: you have a long way to go.



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



Re: [PHP] image inventoryer

2012-04-07 Thread tamouse mailing lists
On Sat, Apr 7, 2012 at 10:35 PM, Kirk Bailey  wrote:
> 
> 
> Image inventory of this directory
> 
> body { margin-left: 10; margin-right: 10%; }
> body {background-attachment:fixed;}
> A:link, A:visited,  A:active { text-decoration:none; }
> A:hover { text-decoration:underline; }
> .justify{text-align:justify;}
> .center{text-align:center;}
> 
> 
> 
> This page inventories the contents of this directory and lists all
> image files in order- as
> the computer determines such matters. Here is the full inventory.
> 
> 
>  foreach (glob("*.*") as $filename) {
>    echo ''."\n$filename\n\n";
> }
> ?>
> 
>
>
> This works nicely. copied code from online manual, chainsaw editing to fit,
> superglue in the spare parts needed and it lists them all and composes
> proper img links to display on the inventory page. NOW I have the tool i
> needed; can someone else put this to good work?

Well, congrats on a first somewhat useful program. All I have to say
now is: you have a long way to go.

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



[PHP] image inventoryer

2012-04-07 Thread Kirk Bailey



Image inventory of this directory

body { margin-left: 10; margin-right: 10%; }
body {background-attachment:fixed;}
A:link, A:visited,  A:active { text-decoration:none; }
A:hover { text-decoration:underline; }
.justify{text-align:justify;}
.center{text-align:center;}



This page inventories the contents of this directory and 
lists all image files in order- as

the computer determines such matters. Here is the full inventory.


'."\n$filename\n\n";
}
?>



This works nicely. copied code from online manual, chainsaw editing 
to fit, superglue in the spare parts needed and it lists them all 
and composes proper img links to display on the inventory page. NOW 
I have the tool i needed; can someone else put this to good work?


--
end

Very Truly yours,
 - Kirk Bailey,
   Largo Florida

   kniht
  +-+
  | BOX |
  +-+
   think


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



Re: [PHP] image inventoryer

2012-04-06 Thread Jim Giner

"tamouse mailing lists"  wrote in message 
news:CAHUC_t-M_dg_D+if01BQm=RPd=GgL7d=naxfadxwybse-nn...@mail.gmail.com...
> knowledge. Read first. Ask smart questions. There are BOATLOADS of
> tutorials on PHP on the net, just a google away.

I like that!  "just a google away".  :) 



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



Re: [PHP] image inventoryer

2012-04-06 Thread tamouse mailing lists
On Thu, Apr 5, 2012 at 10:04 PM, Kirk Bailey  wrote:
> jim, I am a novice at this language as I said.
> And were people this nice to you when YOU asked beginner questions?

When I ask beginner questions, I spend time doing my homework first.
This list is not a class to teach you to write PHP. The people here
are not going to hold your hand and feed you spoonfuls of PHP
knowledge. Read first. Ask smart questions. There are BOATLOADS of
tutorials on PHP on the net, just a google away.

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



Re: [PHP] image inventoryer

2012-04-06 Thread Tedd Sperling
On Apr 5, 2012, at 10:26 PM, Kirk Bailey wrote:

> I need a page that will live in a directory and list all image files in 
> there. That is, the page has
> 
> tags emitted in it's structure, one per file in the directory with a saught 
> file type- .png, .gif, .jpg, you get the idea.
> this should use relative addressing so once the tool is built I can use it in 
> other directories as is.
> 
> Now ai am still a novice at p[hp, how can I do this ?
> 
> -- 
> end
> 
> Very Truly yours,
> - Kirk Bailey,


Kirk:

That will be a good exercise for you. If you want help, then show us something 
where you did something other than ask for the code.

For example, show us *your* code (or attempt) to list all the files in a 
directory. That's pretty simple. After you do that, then we can move on to the 
next step.

Please realize we are not here to write code for you  but rather to help you 
with *your* code.

Cheers,

tedd

_
tedd.sperl...@gmail.com
http://sperling.com

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



Re: [PHP] image inventoryer

2012-04-06 Thread David OBrien
On Apr 6, 2012 9:51 AM, "Jim Giner"  wrote:
>
> "David OBrien"  wrote in message
> news:CAF=yD_06vDEHLP-nyEJxUNt6nHexA42X90U5-6+MBzc0=tc...@mail.gmail.com...
> >>
> > I googled "php show images in folder" and lo and behold  the first was
was
> > a script almost exactly what you are wanting to do
> >
> Damn - now the OP missed a golden opportunity to do some research!  :)
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

It's been my experience if they haven't even used google to see what
premade scripts are available to do something similar then the research
ain't gonna happen.

They'd just post on ee or another forum where they could get the answer
easier


Re: [PHP] image inventoryer

2012-04-06 Thread Jim Giner
"David OBrien"  wrote in message 
news:CAF=yD_06vDEHLP-nyEJxUNt6nHexA42X90U5-6+MBzc0=tc...@mail.gmail.com...
>>
> I googled "php show images in folder" and lo and behold  the first was was
> a script almost exactly what you are wanting to do
>
Damn - now the OP missed a golden opportunity to do some research!  :) 



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



Re: [PHP] image inventoryer

2012-04-06 Thread David OBrien
On Fri, Apr 6, 2012 at 8:34 AM, Jim Giner wrote:

> "Kirk Bailey"  wrote in message
> news:4f7e5d2f.3050...@howlermonkey.net...
> > jim, I am a novice at this language as I said.
> >
>
> Then you are taking on too big of a task.
>
> When I decided to pick up some web programming skills I bought a $50
> book/manual on learning PHP and another on MySQL.  I read them - cover to
> cover.  Then I made up simple tasks to develop in order to LEARN how it's
> actually done.  Sounds like you not only want someone to program it for
> you,
> but probably help you implement it too.  Sure - I or someone with time on
> their hands - could reply back with a couple hundred lines of code and give
> you your answer.  Then what would you have gained?
>
> Hey - I gave you the outline of how this goal of yours could be
> accomplished.  No need for your own pseudo-code at this point.  Take mine
> and go do some research!  Have fun!  Then come back for clarification on
> what you're doing wrong once you have some actual code written.
>
> >>
> > And were people this nice to you when YOU asked beginner questions?
> >>
> When I asked beginner questions, it was AFTER I had written something and
> ran into a roadblock.  NOT before I had set pen to paper.  You're asking
> how
> to get to California without having consulted a map yet.  This site will be
> there for you when you have a problem - don't worry.  Me included, not that
> my input is that worthy.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
I googled "php show images in folder" and lo and behold  the first was was
a script almost exactly what you are wanting to do


Re: [PHP] image inventoryer

2012-04-06 Thread Jim Giner
"Kirk Bailey"  wrote in message 
news:4f7e5d2f.3050...@howlermonkey.net...
> jim, I am a novice at this language as I said.
>

Then you are taking on too big of a task.

When I decided to pick up some web programming skills I bought a $50 
book/manual on learning PHP and another on MySQL.  I read them - cover to 
cover.  Then I made up simple tasks to develop in order to LEARN how it's 
actually done.  Sounds like you not only want someone to program it for you, 
but probably help you implement it too.  Sure - I or someone with time on 
their hands - could reply back with a couple hundred lines of code and give 
you your answer.  Then what would you have gained?

Hey - I gave you the outline of how this goal of yours could be 
accomplished.  No need for your own pseudo-code at this point.  Take mine 
and go do some research!  Have fun!  Then come back for clarification on 
what you're doing wrong once you have some actual code written.

>>
> And were people this nice to you when YOU asked beginner questions?
>>
When I asked beginner questions, it was AFTER I had written something and 
ran into a roadblock.  NOT before I had set pen to paper.  You're asking how 
to get to California without having consulted a map yet.  This site will be 
there for you when you have a problem - don't worry.  Me included, not that 
my input is that worthy. 



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



Re: [PHP] image inventoryer

2012-04-05 Thread Tommy Pham
On Thu, Apr 5, 2012 at 8:02 PM, Kirk Bailey  wrote:

If you don't want to read the manual or a book, you could quickly do
some Google'ing as below:

> ok.
>  filelist=inventory all files in directory "./"
>
filesystem site:php.net

> for file in filelist: // walk a listing of many items

loop site:php.net

>    IF filetype in "gif, jpg, png" {

condition site:php.net

>        echo ''
> // notice that is a 'singlequote' immedately followed by a "doublequote".
> ?>

Or just look at the table of contents in the official manual to see
what PHP has to offer and see what you can do since you already have
some programming experience.

>
> Something like this. In python I would write something like:
>
> #!/usr/bin/python
> import string, glob
> files=glob.glob("./*.*")                             # files is a list
> variable (a 1 dimensional addressable array)
> for file in files:                                         # for each cell
> in files do this doblock:
>    if str.split(file,'.')[1] in "gif","jpg","png"): #if the file type is in
> a list of acceptable types,
>        print ''        # print out the material to
> return surrounding
>                                                             # the file name
>
>
>
>
>
>
> On 4/5/2012 10:34 PM, Tommy Pham wrote:
>>
>> On Thu, Apr 5, 2012 at 7:26 PM, Kirk Bailey
>>  wrote:
>>>
>>> Now ai am still a novice at p[hp, how can I do this ?
>>>
>> Have you read any book on PHP?  even the official from PHP.net?  Learn
>> the tool so you know how to use it, efficiently.  Otherwise how do you
>> know if the tool can do what you want...  What you're asking for ATM
>> is someone to write the code for you which is not how it works.  You
>> need to provide some code, or even pseudo code at least...
>>
>> HTH,
>> Tommy
>>
>

PS:  don't top post since it's preferred on this list.  You can search
the archive for the discussion about it.

HTH,
Tommy

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



Re: [PHP] image inventoryer

2012-04-05 Thread Kirk Bailey

jim, I am a novice at this language as I said.

On 4/5/2012 10:44 PM, Jim Giner wrote:

As Tommy says - you sound like a total new user who doesn't know how to do
it and furthermore doesn't know how many things you are going to have to
pick up just to accomplish this task.

You have to:

determine the folder your script is running from
collect an array of  image file names from that directory
determine the size of each of these images so that you are not building some
html that will try to display an unmanageable amount of data all at once.
You may then have to learn how to create smaller images for your img tags,
which is another learning process in itself
determine how many images you will display and decide again if you really
can allow the user to make this kind of request.  This could also create
another step in the process to keep track of what images have already been
displayed so that when the screen comes back to your script you can pick up
where you left off and display a second page.

THEN you can generate the html to produce a useful page of images.

At least that's how I would approach it. And I'm not an expert but simply a
guy who has put in about a year's worth of effort into learning enough php
to actually do something like this already, among other things.


And were people this nice to you when YOU asked beginner questions?




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



Re: [PHP] image inventoryer

2012-04-05 Thread Kirk Bailey

ok.
'
// notice that is a 'singlequote' immedately followed by a 
"doublequote".

?>

Something like this. In python I would write something like:

#!/usr/bin/python
import string, glob
files=glob.glob("./*.*") # files is a 
list variable (a 1 dimensional addressable array)
for file in files: # for 
each cell in files do this doblock:
if str.split(file,'.')[1] in "gif","jpg","png"): #if the file 
type is in a list of acceptable types,
print ''# print out the 
material to return surrounding
 # the 
file name






On 4/5/2012 10:34 PM, Tommy Pham wrote:

On Thu, Apr 5, 2012 at 7:26 PM, Kirk Bailey  wrote:

Now ai am still a novice at p[hp, how can I do this ?


Have you read any book on PHP?  even the official from PHP.net?  Learn
the tool so you know how to use it, efficiently.  Otherwise how do you
know if the tool can do what you want...  What you're asking for ATM
is someone to write the code for you which is not how it works.  You
need to provide some code, or even pseudo code at least...

HTH,
Tommy



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



Re: [PHP] image inventoryer

2012-04-05 Thread Jim Giner
As Tommy says - you sound like a total new user who doesn't know how to do 
it and furthermore doesn't know how many things you are going to have to 
pick up just to accomplish this task.

You have to:

determine the folder your script is running from
collect an array of  image file names from that directory
determine the size of each of these images so that you are not building some 
html that will try to display an unmanageable amount of data all at once. 
You may then have to learn how to create smaller images for your img tags, 
which is another learning process in itself
determine how many images you will display and decide again if you really 
can allow the user to make this kind of request.  This could also create 
another step in the process to keep track of what images have already been 
displayed so that when the screen comes back to your script you can pick up 
where you left off and display a second page.

THEN you can generate the html to produce a useful page of images.

At least that's how I would approach it. And I'm not an expert but simply a 
guy who has put in about a year's worth of effort into learning enough php 
to actually do something like this already, among other things. 



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



Re: [PHP] image inventoryer

2012-04-05 Thread Tommy Pham
On Thu, Apr 5, 2012 at 7:26 PM, Kirk Bailey  wrote:
>
> Now ai am still a novice at p[hp, how can I do this ?
>

Have you read any book on PHP?  even the official from PHP.net?  Learn
the tool so you know how to use it, efficiently.  Otherwise how do you
know if the tool can do what you want...  What you're asking for ATM
is someone to write the code for you which is not how it works.  You
need to provide some code, or even pseudo code at least...

HTH,
Tommy

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



[PHP] image inventoryer

2012-04-05 Thread Kirk Bailey
I need a page that will live in a directory and list all image files 
in there. That is, the page has


tags emitted in it's structure, one per file in the directory with a 
saught file type- .png, .gif, .jpg, you get the idea.
this should use relative addressing so once the tool is built I can 
use it in other directories as is.


Now ai am still a novice at p[hp, how can I do this ?

--
end

Very Truly yours,
 - Kirk Bailey,
   Largo Florida

   kniht
  +-+
  | BOX |
  +-+
   think


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



Re: [PHP] Image Rotation Script

2011-10-16 Thread Curtis Maurand


There are tons of (free) jquery gadgets that do image rotation.  All 
you'd need to do is push the list out to the jquery script.


Cheers,
Curtis

On 10/15/2011 10:50 AM, d...@nkmo.com wrote:

We have a simple script which rotates and image to a random value, saves
it to a cache directory and displays it. For some reason when I move the
script from a Debian box over to the production CentOS machine, it no
longer caches any of the images. the rest works, but not the cache. If you
could look at it and see if anything jumps out at you, please let me know.

install the code below to the directory /angles


.htaccess:
RewriteEngine on
RewriteRule ^rotate_(\d+)(?:_(?:\d+))?.png$ rotate.php?im=$1

rotate.php:


Use it by url:
http://www.servername.com/angles/rotate_019.png
Each time you reload page the angle should rotate to a new position.






Re: [PHP] Image Rotation Script

2011-10-15 Thread Stuart Dallas
On 15 Oct 2011, at 15:50, d...@nkmo.com wrote:

> We have a simple script which rotates and image to a random value, saves
> it to a cache directory and displays it. For some reason when I move the
> script from a Debian box over to the production CentOS machine, it no
> longer caches any of the images. the rest works, but not the cache. If you
> could look at it and see if anything jumps out at you, please let me know.
> 
> install the code below to the directory /angles
> 
> 
> .htaccess:
> RewriteEngine on
> RewriteRule ^rotate_(\d+)(?:_(?:\d+))?.png$ rotate.php?im=$1
> 
> rotate.php:
>  // Setup
> if(isset($_GET['im']) && file_exists($_GET['im'].'.png')) {
> header('Content-type: image/png');
> $im = $_GET['im'].'.png';
> $degrees = rand(0, 360);
> $save = 'cache/'.$_GET['im'].'_'.$degrees.'.png';
> if(!file_exists($save)) {
> // Rotate via "command line" and cache it
> exec('convert '.$im.' -filter \'Lanczos\' -resize \'150x150\' -rotate
> '.$degrees.' -black-threshold 40% '.$save, $out);
> }
> // Output out (newly?) cached file
> echo file_get_contents($save);
> } else {
> die("Image not found");
> }
> ?>
> 
> Use it by url:
> http://www.servername.com/angles/rotate_019.png
> Each time you reload page the angle should rotate to a new position.

My first thought was that the current working directory is probably set 
differently. However, you say that the script works and presents the rotated 
images, it's just the cache that isn't right. I still think I'm probably 
correct, so try these changes...

> $im = dirname(__FILE__).'/'.$_GET['im'].'.png';


and...

> $save = dirname(__FILE__).'/cache/'.$_GET['im'].'_'.$degrees.'.png';

You also have a pretty major hole here because you're taking a querystring 
parameter and putting it straight into a command line. What happens if I pass 
the value of $_GET['im'] as "../../../../../../../../../../../etc/passwd" ? Use 
escapeshellarg when putting variables into command lines to protect against 
this type of hack.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/


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



[PHP] Image Rotation Script

2011-10-15 Thread dev
We have a simple script which rotates and image to a random value, saves
it to a cache directory and displays it. For some reason when I move the
script from a Debian box over to the production CentOS machine, it no
longer caches any of the images. the rest works, but not the cache. If you
could look at it and see if anything jumps out at you, please let me know.

install the code below to the directory /angles


.htaccess:
RewriteEngine on
RewriteRule ^rotate_(\d+)(?:_(?:\d+))?.png$ rotate.php?im=$1

rotate.php:


Use it by url:
http://www.servername.com/angles/rotate_019.png
Each time you reload page the angle should rotate to a new position.
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Image question for runways

2010-09-14 Thread Alexis

Hi,

I am trying to create an on the fly image of runway layouts but am 
hitting a brick wall.


I have both the starting and ending coordinates of each runway, it's 
length, as well as it's angle of direction (heading).


I can draw one runway without any problem, but where I am falling short 
is how to 'scale', if that is the right word, the other runway(s) to 
display properly in a 500x500px image



function imagepolarline($image,$x1,$y1,$length,$angle,$color)
{
$length=($length/500)*20;
$x2 = $x1 + cos( deg2rad($angle-90)) * $length;
$y2 = $y1 + sin( deg2rad($angle-90)) * $length;
imageline($image, $x1,$y1,$x2,$y2, $color); 
}

//'base' coords
$x1=200;$y1=200;

$scale=1;

//if first runway
if ($d==0) {$xbase=abs($lon1);$ybase=abs($lat1);}
//for all others
else
{
$x1=$x1+(($xbase-(abs($lon1)))*$scale);
$y1=$y1+(($ybase-(abs($lat1)))*$scale);
}


Here is some test data if that would help:
"length","lat_start","lon_start","heading","lat_stop","lon_stop"
"6869","38.8424","-77.0368","355.5000","38.8612","-77.0387"
"4911","38.8423","-77.0408","26.","38.8544","-77.0333"
"5204","38.8617","-77.0438","142.7000","38.8503","-77.0327"

Any suggestions would be most appreciated.

Alexis

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



Re: [PHP] Image Replication

2010-07-20 Thread Bastien Koert
On Tue, Jul 20, 2010 at 10:35 AM,   wrote:
> We are doing it with nfs mount which is mounted on all servers
>
> --
> Shafiq
> http://shafiq.pk
> *** This Message Has Been Sent Using BlackBerry Internet Service from 
> Mobilink ***
>
> -Original Message-
> From: Dan Joseph 
> Date: Tue, 20 Jul 2010 10:21:55
> To: PHP eMail List
> Subject: [PHP] Image Replication
> Hi,
>
> I'm wondering how you all are doing image replication between servers.  I've
> got some things in mind, but I'd like to see how others have done it.
>
> We have a PHP application that accepts an image upload, then we want it to
> show up on the other 2 web servers.  We have 3 in a load balanced cluster.
> Linux servers.
>
> How did you go about it?
>
> --
> -Dan Joseph
>
> http://www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month.
> Promo Code "NEWTHINGS" for 10% off initial order -- Reseller Plans also
> available!
>
> http://www.facebook.com/canishosting
> http://www.facebook.com/originalpoetry
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Our app runs using a piece of SAN / NAS storage common to all servers

-- 

Bastien

Cat, the other other white meat

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



Re: [PHP] Image Replication

2010-07-20 Thread rehmanms
We are doing it with nfs mount which is mounted on all servers

--
Shafiq
http://shafiq.pk
*** This Message Has Been Sent Using BlackBerry Internet Service from Mobilink 
***

-Original Message-
From: Dan Joseph 
Date: Tue, 20 Jul 2010 10:21:55 
To: PHP eMail List
Subject: [PHP] Image Replication
Hi,

I'm wondering how you all are doing image replication between servers.  I've
got some things in mind, but I'd like to see how others have done it.

We have a PHP application that accepts an image upload, then we want it to
show up on the other 2 web servers.  We have 3 in a load balanced cluster.
Linux servers.

How did you go about it?

-- 
-Dan Joseph

http://www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month.
Promo Code "NEWTHINGS" for 10% off initial order -- Reseller Plans also
available!

http://www.facebook.com/canishosting
http://www.facebook.com/originalpoetry



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



Re: [PHP] Image Replication

2010-07-20 Thread Per Jessen
Dan Joseph wrote:

> Hi,
> 
> I'm wondering how you all are doing image replication between servers.
>  I've got some things in mind, but I'd like to see how others have
> done it.
> 
> We have a PHP application that accepts an image upload, then we want
> it to show up on the other 2 web servers.  We have 3 in a load
> balanced cluster. Linux servers.
> 
> How did you go about it?

rsync triggered by inotify.


-- 
Per Jessen, Zürich (27.8°C)


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



[PHP] Image Replication

2010-07-20 Thread Dan Joseph
Hi,

I'm wondering how you all are doing image replication between servers.  I've
got some things in mind, but I'd like to see how others have done it.

We have a PHP application that accepts an image upload, then we want it to
show up on the other 2 web servers.  We have 3 in a load balanced cluster.
Linux servers.

How did you go about it?

-- 
-Dan Joseph

http://www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month.
Promo Code "NEWTHINGS" for 10% off initial order -- Reseller Plans also
available!

http://www.facebook.com/canishosting
http://www.facebook.com/originalpoetry


Re: [PHP] image thumbnail from blob data

2010-06-06 Thread Adam Richardson
On Sun, Jun 6, 2010 at 8:24 PM, Phpster  wrote:

>
>
> On Jun 6, 2010, at 5:51 PM, Paul M Foster  wrote:
>
>  On Sun, Jun 06, 2010 at 09:55:20PM +0100, Ashley Sheridan wrote:
>>
>> 
>>
>>
>>> Having said that, it's not generally a good idea to store images as
>>> blobs in my experience. It can create slowdowns in database access, and
>>> increases the amount of space the db requires by a lot! What most people
>>> do I've found is to store the image as a file and store the path and
>>> filename to it in the db. However, if the location is going to change
>>> often then it might be best to store it as a blob like you're doing.
>>>
>>>
>> +1
>>
>> Storing blobs in an RDBMS is an abuse of the technology, IMO. RDBMSes
>> were not originally designed to store this type of information, and as
>> Ash pointed out, it still can create problems. His assessment of the
>> preferred method for storing this type of information is spot on. Store
>> them in a file and then store the file location in your database.
>>
>> I don't know, but this might be use case for the new generation of NoSQL
>> databases. I have very little knowledge of how they store data, but I
>> would assume they're more accustomed to storing blobs and whole
>> documents. And if not, then someone should come up with one which works
>> this way. It would be relatively simple to create a key-locaton table
>> (using dbm or somesuch) and have all the actual "data" stored in files.
>>
>> Paul
>>
>> --
>> Paul M. Foster
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
> In my experience, most RDBMs fail at blobs and internally they still store
> it as a file with a pointer. It's also worthwhile noting that in all cases,
> after a certain size in the db is reached, performance is impacted. With
> mysql, it seems to be about 12gb and with SQL server it's around the 15gb
> size.
>
> I had to write a script that would pull those images and store them on the
> file system and when run, it reduced the size of the db to about 1 gb in all
> instances, if not smaller. This dramatic change reduces back up time and
> costs, making the clients way happier since the performace also picked up.
>
> As mentioned, it's just not worth storing in the db.
>
> Bastien
>
> Sent from my iPod
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Hi all,

Indeed, I believe that the balance typically shifts in favor of storing meta
information about the image in the database, leaving the web server to
handle storing the actual image.  However, I've also worked on apps where
the balance appeared to shift towards storing the image in the DB.

For example, we were running ASP.Net, had 1 load balancer, 3 web servers,
and 1 super-duper DB server (the site is subject to very large spikes, and
generally high traffic.)  The client used my custom CMS to administer
content, including images (not for the site templates, but rather for the
items they were specifically managing on their site.)

I could have chosen to store the images on one of the web servers, but that
posed issues in terms of maintenance and also the webservers were not as
reliable as the DB (per SLA and the equipment used, as the DB server had
internal redundancies built-in, and those who've worked with IIS are likely
familiar with the "It's not working, let's just reboot" methodology for
servers.)  I could have duplicated the images across all of the servers.
 However, keeping things synched, when coupled with the security
requirements, proved to add a fair amount of complexity (not that it was
impossible, but troublesome given the budget, timeline, and the fact I
wasn't the sa.)  I could have set up another server as a media server, but
that wasn't logistically feasible at the time (there are other options I've
not mentioned, too.)

I decided to examine the performance of an architecture where we stored the
images in the DB, as this app was unique in a few ways.  First, each image
was limited to less-than 45KB (pretty small.)  Second, the DB is relatively
small, containing thousands of items that they manage (old records are
frequently purged.)  After running several benchmarks, I realized that the
website performed very well using this architecture (although I found
several other issues in terms of performance, not that they were because of
my [cough] code ;)

I sometimes hear people lament the speed of PHP.  As Rasmus Lerdorf points
out in his presentation "Simple is Hard" (
http://talks.php.net/show/froscon08), PHP is rarely the bottleneck.  When I
ask those who take issue with PHP's speed what they're basing it on, I find
few back it up with meaningful numbers, or if they do, they're pointing to
the comparison of PHP to some other language while running a for loop, which
is interesting if you're writing a for-looper app.  Rarely have these
naysayers benchmarked PHP in the greater ecosystem o

Re: [PHP] image thumbnail from blob data

2010-06-06 Thread Phpster



On Jun 6, 2010, at 5:51 PM, Paul M Foster   
wrote:



On Sun, Jun 06, 2010 at 09:55:20PM +0100, Ashley Sheridan wrote:





Having said that, it's not generally a good idea to store images as
blobs in my experience. It can create slowdowns in database access,  
and
increases the amount of space the db requires by a lot! What most  
people

do I've found is to store the image as a file and store the path and
filename to it in the db. However, if the location is going to change
often then it might be best to store it as a blob like you're doing.



+1

Storing blobs in an RDBMS is an abuse of the technology, IMO. RDBMSes
were not originally designed to store this type of information, and as
Ash pointed out, it still can create problems. His assessment of the
preferred method for storing this type of information is spot on.  
Store

them in a file and then store the file location in your database.

I don't know, but this might be use case for the new generation of  
NoSQL

databases. I have very little knowledge of how they store data, but I
would assume they're more accustomed to storing blobs and whole
documents. And if not, then someone should come up with one which  
works

this way. It would be relatively simple to create a key-locaton table
(using dbm or somesuch) and have all the actual "data" stored in  
files.


Paul

--
Paul M. Foster

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



In my experience, most RDBMs fail at blobs and internally they still  
store it as a file with a pointer. It's also worthwhile noting that in  
all cases, after a certain size in the db is reached, performance is  
impacted. With mysql, it seems to be about 12gb and with SQL server  
it's around the 15gb size.


I had to write a script that would pull those images and store them on  
the file system and when run, it reduced the size of the db to about 1  
gb in all instances, if not smaller. This dramatic change reduces back  
up time and costs, making the clients way happier since the performace  
also picked up.


As mentioned, it's just not worth storing in the db.

Bastien

Sent from my iPod

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



Re: [PHP] image thumbnail from blob data

2010-06-06 Thread Paul M Foster
On Sun, Jun 06, 2010 at 09:55:20PM +0100, Ashley Sheridan wrote:



> 
> Having said that, it's not generally a good idea to store images as
> blobs in my experience. It can create slowdowns in database access, and
> increases the amount of space the db requires by a lot! What most people
> do I've found is to store the image as a file and store the path and
> filename to it in the db. However, if the location is going to change
> often then it might be best to store it as a blob like you're doing.
> 

+1

Storing blobs in an RDBMS is an abuse of the technology, IMO. RDBMSes
were not originally designed to store this type of information, and as
Ash pointed out, it still can create problems. His assessment of the
preferred method for storing this type of information is spot on. Store
them in a file and then store the file location in your database.

I don't know, but this might be use case for the new generation of NoSQL
databases. I have very little knowledge of how they store data, but I
would assume they're more accustomed to storing blobs and whole
documents. And if not, then someone should come up with one which works
this way. It would be relatively simple to create a key-locaton table
(using dbm or somesuch) and have all the actual "data" stored in files.

Paul

-- 
Paul M. Foster

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



Re: [PHP] image thumbnail from blob data

2010-06-06 Thread Karl DeSaulniers



Sent from losPhone

On Jun 6, 2010, at 3:55 PM, Ashley Sheridan   
wrote:



On Mon, 2010-06-07 at 02:37 +0600, saeed ahmed wrote:


hello friends,

image store into database in a blob field, But when I'm trying to  
retrieve

it from the database then its cause problems.

if I'm trying header( "Content-type: image/jpeg") (if my image type  
is
jpeg), then its working well. but when I'm trying to mixing up this  
with
some HTML code then its not working. Ok I understand its not  
working because

the header already sent by the browser.

now suggest me what should I use there to retrieve the image from  
database?
I have to mix the HTML code in my script. So is their any other way  
to do

this without header?

saeed ahmed
http://saeed05.wordpress.com



Have one script that just fetches the image and sets the header for
that, and then fetch the content. I am assuming that you are storing  
the
images separate from the HTML in this case anyway? The only way to  
have

the image data inline with the HTML that I know of is to base64 encode
the image data, but that won't work on Internet Explorer (other decent
browsers work fine though)

Having said that, it's not generally a good idea to store images as
blobs in my experience. It can create slowdowns in database access,  
and
increases the amount of space the db requires by a lot! What most  
people

do I've found is to store the image as a file and store the path and
filename to it in the db.


+1

I would reccomend this as well. You may find blobs to be more of hogs  
then blobs as things go forward. Store the link to the images in your  
DB and store the images in their own folder on the server. That's been  
the best way in my experience. Even with images changing out.


GL

Karl

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



Re: [PHP] image thumbnail from blob data

2010-06-06 Thread Ashley Sheridan
On Mon, 2010-06-07 at 02:37 +0600, saeed ahmed wrote:

> hello friends,
> 
> image store into database in a blob field, But when I'm trying to retrieve
> it from the database then its cause problems.
> 
> if I'm trying header( "Content-type: image/jpeg") (if my image type is
> jpeg), then its working well. but when I'm trying to mixing up this with
> some HTML code then its not working. Ok I understand its not working because
> the header already sent by the browser.
> 
> now suggest me what should I use there to retrieve the image from database?
> I have to mix the HTML code in my script. So is their any other way to do
> this without header?
> 
> saeed ahmed
> http://saeed05.wordpress.com


Have one script that just fetches the image and sets the header for
that, and then fetch the content. I am assuming that you are storing the
images separate from the HTML in this case anyway? The only way to have
the image data inline with the HTML that I know of is to base64 encode
the image data, but that won't work on Internet Explorer (other decent
browsers work fine though)

Having said that, it's not generally a good idea to store images as
blobs in my experience. It can create slowdowns in database access, and
increases the amount of space the db requires by a lot! What most people
do I've found is to store the image as a file and store the path and
filename to it in the db. However, if the location is going to change
often then it might be best to store it as a blob like you're doing.

Thanks,
Ash
http://www.ashleysheridan.co.uk




[PHP] image thumbnail from blob data

2010-06-06 Thread saeed ahmed
hello friends,

image store into database in a blob field, But when I'm trying to retrieve
it from the database then its cause problems.

if I'm trying header( "Content-type: image/jpeg") (if my image type is
jpeg), then its working well. but when I'm trying to mixing up this with
some HTML code then its not working. Ok I understand its not working because
the header already sent by the browser.

now suggest me what should I use there to retrieve the image from database?
I have to mix the HTML code in my script. So is their any other way to do
this without header?

saeed ahmed
http://saeed05.wordpress.com


[PHP] PHP Image Host - Sending HTTP Headers Twice?

2010-05-10 Thread APseudoUtopia
I have a php script which serves an image. It's very simple:

header('Content-Type: image/' . $ImageData['content_type']);
readfile($File);

When viewing the script with the Firefox Extension: LiveHTTPHeaders,
it gives the following output for a SINGLE request:

--
https://domain.tld/img.php?i=260

GET /img.php?i=260 HTTP/1.1
Host: domain.tld
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US;
rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: UTF-8,*
Keep-Alive: 115
Connection: keep-alive
Cookie: session=blahblah
Cache-Control: max-age=0

HTTP/1.1 200 OK
Server: nginx
Date: Mon, 10 May 2010 20:17:09 GMT
Content-Type: image/jpeg
Transfer-Encoding: chunked
Connection: keep-alive
--
https://domain.tld/img.php?i=260

GET /img.php?i=260 HTTP/1.1
Host: domain.tld
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US;
rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: UTF-8,*
Keep-Alive: 115
Connection: keep-alive

HTTP/1.1 200 OK
Server: nginx
Date: Mon, 10 May 2010 20:17:10 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Content-Encoding: gzip
--



As you can see, the browser is requesting the image twice, and PHP is
sending two different Content-Type headers. Why is this?

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



Re: [PHP] image question again

2010-04-07 Thread Ashley Sheridan
On Tue, 2010-04-06 at 21:44 -0500, Karl DeSaulniers wrote:

> When I have an imagecreatetruecolor and I create another one and use  
> imagecopymerge, how do I keep the backgrounds transparent even if say  
> the width of the top image is smaller than the back image?
> I keep getting a black background where the top image does not cover  
> the back. It sets the transparency to the rest of the top image as  
> long as it is covering the bottom one. I think it has to do with the  
> imagealphablending.
> Any ideas?
> TIA
> 
> Karl DeSaulniers
> Design Drumm
> http://designdrumm.com
> 


If it's just that the images are different sizes, then imagecopyresample
might be the better option.

Thanks,
Ash
http://www.ashleysheridan.co.uk




[PHP] image question again

2010-04-06 Thread Karl DeSaulniers
When I have an imagecreatetruecolor and I create another one and use  
imagecopymerge, how do I keep the backgrounds transparent even if say  
the width of the top image is smaller than the back image?
I keep getting a black background where the top image does not cover  
the back. It sets the transparency to the rest of the top image as  
long as it is covering the bottom one. I think it has to do with the  
imagealphablending.

Any ideas?
TIA

Karl DeSaulniers
Design Drumm
http://designdrumm.com



Re: [PHP] image upload keeps file name ?

2010-04-01 Thread Midhun Girish
  I use the follwing function for moving files:


public function moveFile($file,$targetdir="../uploads/images/")
  {
$fileName = $file['name'];
$ext = substr($fileName, strrpos($fileName, '.') + 1);
do
{

$targetfilename=md5(date("m.d.y.h.i.s").basename($fileName)).'.'.$ext;
  $fullname=$targetdir.$targetfilename;
}while(file_exists($fullname));
move_uploaded_file($file["tmp_name"],$fullname);
return $fullname;
  }


Call the fn as :

foreach($_FILES as $file_name => $filearray)
{
if( $filearray['error']=='')
{
   $filenametobestored=moveFile($filearray);
   /*Enter name into db here*/
}
}


this will make sure you never over write anyfiles..


Midhun Girish

On Thu, Apr 1, 2010 at 3:25 PM, Ashley Sheridan 
wrote:

> of the web
> root, which will prevent people from maliciously uploadi
>


Re: [PHP] image upload keeps file name ?

2010-04-01 Thread Ashley Sheridan
On Thu, 2010-04-01 at 10:51 +0100, Matthew Croud wrote:

> Hi Guys,
> 
> Can someone confirm for me that the code below will move an uploaded  
> file and give it the same name as the original image file name ?
> 
> 
> $file_dir = "/home/uploads";
> foreach($_FILES as $file_name => $file_array) {
>   echo "path: ".$file_array["tmp_name"]."\n";
>   echo "name: ".$file_array["name"]."\n";
>   echo "type: ".$file_array["type"]."\n";
>   echo "size: ".$file_array["size"]."\n";
>   
>   $UploadName[$num] = $file_array["name"];
>  $num++;
> 
>   if (is_uploaded_file($file_array["tmp_name"])) {
>   move_uploaded_file($file_array["tmp_name"], "$file_dir/". 
> $file_array["name"]) or die ("Couldn't copy");
>   echo "file was moved!";
>   }
> }
> 
> 
> 
> Many thanks,
> 
> 
> 
> 
> 


Yes, the original filename comes from the ["name"] array element.
However, if someone is uploading a filename with the same name as one
that already exists, you will be overwriting it.

For peace of mind, I've always found it best to save the file using the
tmp_name given to it by PHP, and store this against the original
filename in a database. You can then use PHP to deliver the file back to
the user when it's needed as either a download or something displayed in
the browser. This works nicely with storing files outside of the web
root, which will prevent people from maliciously uploading files to
attempt to break your server and/or app.

Thanks,
Ash
http://www.ashleysheridan.co.uk




[PHP] image upload keeps file name ?

2010-04-01 Thread Matthew Croud

Hi Guys,

Can someone confirm for me that the code below will move an uploaded  
file and give it the same name as the original image file name ?



$file_dir = "/home/uploads";
foreach($_FILES as $file_name => $file_array) {
echo "path: ".$file_array["tmp_name"]."\n";
echo "name: ".$file_array["name"]."\n";
echo "type: ".$file_array["type"]."\n";
echo "size: ".$file_array["size"]."\n";

$UploadName[$num] = $file_array["name"];
$num++;

if (is_uploaded_file($file_array["tmp_name"])) {
		move_uploaded_file($file_array["tmp_name"], "$file_dir/". 
$file_array["name"]) or die ("Couldn't copy");

echo "file was moved!";
}
}



Many thanks,





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



Re: [PHP] Image Headers break when image is out of bounds

2009-08-11 Thread Ashley Sheridan
On Tue, 2009-08-11 at 11:54 -0700, Ben Dunlap wrote:
> On Tue, Aug 11, 2009 at 11:52 AM, Ben Dunlap
>  wrote:
> 
> @Adam
> 
> The headers_sent() wasa  test to ensure that no other
> data was creeping
> into the headers before I wanted it to. Keeping it in
> does no harm, as
> it is basically saying, if there are no headers that
> have been sent,
> send the correct ones for the image.
> 
> But if there are headers that have been sent, it sounds like
> they would not have been the correct ones. Which I think would
> cause exactly the problem you're describing.
> 
> Ben
> 
> 
> Oops, looked back at your earlier post and it sounds like you only
> send the image inside the "if(!headers_sent())" block. Never mind, pls
> disregard my earlier noise.
> 
> Ben

Well, this will teach me to pay more attention. Turns out, I was
attempting to output the image before the headers! It was a red herring
that the image was displaying correctly when  the drawing commands were
all inside of the image area. It's probably more of a feature of Fx to
try and recognise the content it's been sent if it can?


Thanks,
Ash
http://www.ashleysheridan.co.uk


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



Re: [PHP] Image Headers break when image is out of bounds

2009-08-11 Thread Ben Dunlap
On Tue, Aug 11, 2009 at 11:52 AM, Ben Dunlap wrote:

>
> @Adam
>> The headers_sent() wasa  test to ensure that no other data was creeping
>> into the headers before I wanted it to. Keeping it in does no harm, as
>> it is basically saying, if there are no headers that have been sent,
>> send the correct ones for the image.
>
>
> But if there are headers that have been sent, it sounds like they would not
> have been the correct ones. Which I think would cause exactly the problem
> you're describing.
>
> Ben
>
> Oops, looked back at your earlier post and it sounds like you only send the
image inside the "if(!headers_sent())" block. Never mind, pls disregard my
earlier noise.

Ben


Re: [PHP] Image Headers break when image is out of bounds

2009-08-11 Thread Ben Dunlap
> @Adam
> The headers_sent() wasa  test to ensure that no other data was creeping
> into the headers before I wanted it to. Keeping it in does no harm, as
> it is basically saying, if there are no headers that have been sent,
> send the correct ones for the image.


But if there are headers that have been sent, it sounds like they would not
have been the correct ones. Which I think would cause exactly the problem
you're describing.

Ben


Re: [PHP] Image Headers break when image is out of bounds

2009-08-11 Thread Ashley Sheridan
On Tue, 2009-08-11 at 13:29 -0500, Adam Shannon wrote:
> On Tue, Aug 11, 2009 at 1:08 PM, Ashley Sheridan
> wrote:
> 
> > On Tue, 2009-08-11 at 19:02 +0100, Ashley Sheridan wrote:
> > > I've got a bit of a weird one here. I'm using PHP to output an image.
> > > This works fine when I output as a file, but when I try to feed it
> > > directly to the browser it fills the screen with random characters.
> > >
> > > I know I've got the headers right, as it works some of the time. The
> > > only thing I can spot when it does fail is that some of the image
> > > drawing commands are essentially drawing off the edge of the image area.
> > > I've checked the error logs, and the only errors/notices I can find
> > > today are a bug in phpMyAdmin and a missing favicon file, nothing to do
> > > with this script.
> > >
> > > Has anybody ever noticed a similar problem?
> > >
> > > Thanks,
> > > Ash
> > > http://www.ashleysheridan.co.uk
> > >
> > >
> > Oh. I should note that there has been no headers sent already, as I put
> > the image output part inside of a if(!headers_sent()) block. The headers
> > I'm using for the PNG image are:
> >
> > header("Content-Type: image/png");
> > header("Pragma: no-cache");
> > header("Expires: 0");
> >
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> Take the if (!headers_sent()) out and always send the headers.
> 
@Adam
The headers_sent() wasa  test to ensure that no other data was creeping
into the headers before I wanted it to. Keeping it in does no harm, as
it is basically saying, if there are no headers that have been sent,
send the correct ones for the image.

@Martin
The image is being produced by PHP. The command I'm using to output the
image is image_png(), and my OS is correctly reporting a PNG image
(Linux will use the extension as a hint, but gets the filetype from the
contents). Also, for further clarification, the junk output I'm getting
has the letters PNG in the first few characters, so I'm pretty sure this
is a PNG image yes!

Thanks,
Ash
http://www.ashleysheridan.co.uk


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



Re: [PHP] Image Headers break when image is out of bounds

2009-08-11 Thread Adam Shannon
On Tue, Aug 11, 2009 at 1:08 PM, Ashley Sheridan
wrote:

> On Tue, 2009-08-11 at 19:02 +0100, Ashley Sheridan wrote:
> > I've got a bit of a weird one here. I'm using PHP to output an image.
> > This works fine when I output as a file, but when I try to feed it
> > directly to the browser it fills the screen with random characters.
> >
> > I know I've got the headers right, as it works some of the time. The
> > only thing I can spot when it does fail is that some of the image
> > drawing commands are essentially drawing off the edge of the image area.
> > I've checked the error logs, and the only errors/notices I can find
> > today are a bug in phpMyAdmin and a missing favicon file, nothing to do
> > with this script.
> >
> > Has anybody ever noticed a similar problem?
> >
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
> >
> Oh. I should note that there has been no headers sent already, as I put
> the image output part inside of a if(!headers_sent()) block. The headers
> I'm using for the PNG image are:
>
> header("Content-Type: image/png");
> header("Pragma: no-cache");
> header("Expires: 0");
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Take the if (!headers_sent()) out and always send the headers.

-- 
- Adam Shannon ( http://ashannon.us )


Re: [PHP] Image Headers break when image is out of bounds

2009-08-11 Thread Ashley Sheridan
On Tue, 2009-08-11 at 19:02 +0100, Ashley Sheridan wrote:
> I've got a bit of a weird one here. I'm using PHP to output an image.
> This works fine when I output as a file, but when I try to feed it
> directly to the browser it fills the screen with random characters.
> 
> I know I've got the headers right, as it works some of the time. The
> only thing I can spot when it does fail is that some of the image
> drawing commands are essentially drawing off the edge of the image area.
> I've checked the error logs, and the only errors/notices I can find
> today are a bug in phpMyAdmin and a missing favicon file, nothing to do
> with this script.
> 
> Has anybody ever noticed a similar problem?
> 
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
> 
> 
Oh. I should note that there has been no headers sent already, as I put
the image output part inside of a if(!headers_sent()) block. The headers
I'm using for the PNG image are:

header("Content-Type: image/png");
header("Pragma: no-cache");
header("Expires: 0");

Thanks,
Ash
http://www.ashleysheridan.co.uk


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



[PHP] Image Headers break when image is out of bounds

2009-08-11 Thread Ashley Sheridan
I've got a bit of a weird one here. I'm using PHP to output an image.
This works fine when I output as a file, but when I try to feed it
directly to the browser it fills the screen with random characters.

I know I've got the headers right, as it works some of the time. The
only thing I can spot when it does fail is that some of the image
drawing commands are essentially drawing off the edge of the image area.
I've checked the error logs, and the only errors/notices I can find
today are a bug in phpMyAdmin and a missing favicon file, nothing to do
with this script.

Has anybody ever noticed a similar problem?

Thanks,
Ash
http://www.ashleysheridan.co.uk


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



[PHP] Image Type BMP @ "Save Image As" Dialog on IE

2009-06-26 Thread Nitsan Bin-Nun
I have wrote a PHP script that serves JPEG images in smaller size, the
resize is done using GD on-the-fly.
I have noticed an interesting issue during the "save image as..." dialog on
serveral internet explorer browsers, somehow, for some strange reason, the
JPEG file is shown as BMP file.

I don't know why this is happening, but I'm trying to make it save it as JPG
file.
In firefox or any other browser everything works like a charm.

I have to mention that the JPG file is located in the HTML in the following
format:


I have also used mod_rewrite to serve the file with .jpg extension (I
thought that the strange IE may not know how to recognize it..), the PHP
file is sending the correct headers, I'm attaching an example for HTTP
request & response for this resized image:

GET /gallery-image-dolphinim-12450163853. HTTP/1.1
Host: www.dolphinim.net
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10)
Gecko/2009042316 Firefox/3.0.10 FirePHP/0.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: PHPSESSID=e4542edfa5bcb7904e351d39c341fffa

HTTP/1.x 200 OK
Date: Fri, 26 Jun 2009 16:18:52 GMT
Server: Apache/1.3.41 (Unix) PHP/5.2.6 mod_log_bytes/1.2 mod_bwlimited/1.4
mod_auth_passthrough/1.8 FrontPage/5.0.2.2635 DAV/1.0.3 mod_ssl/2.8.31
OpenSSL/0.9.8e-fips-rhel5
X-Powered-By: PHP/5.2.6
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0
Pragma: no-cache
Keep-Alive: timeout=15, max=98
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: image/jpeg


Any directions will be highly appreciated!

Thanks!


Re: [PHP] Image Resizing

2008-12-21 Thread Gary Maddock-Greene

nice post Tedd and useful web site :)

-Gary

"tedd"  wrote in message 
news:p06240802c573f5a71...@[192.168.1.101]...

At 12:38 PM -0800 12/20/08, Stephen Alistoun wrote:

Hi all,

What is the best way in PHP to Resize an Image to a specific width.

For Example I have images in the following sizes:

(1) 200px width and 350px height
(2) 125px width and 220px height
(3) 166px width and 455px height

I want all the images to resize to 100px width but the height adjusts
automatically.

Regards,

Stephen


Stephen:

Here's the code.

http://webbytedd.com/b/thumb/

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com 



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



Re: [PHP] Image Resizing

2008-12-21 Thread tedd

At 12:38 PM -0800 12/20/08, Stephen Alistoun wrote:

Hi all,

What is the best way in PHP to Resize an Image to a specific width.

For Example I have images in the following sizes:

(1) 200px width and 350px height
(2) 125px width and 220px height
(3) 166px width and 455px height

I want all the images to resize to 100px width but the height adjusts
automatically.

Regards,

Stephen


Stephen:

Here's the code.

http://webbytedd.com/b/thumb/

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Image Resizing

2008-12-21 Thread Jason Paschal
i use imageMagick:

http://www.imagemagick.org/Magick++/Geometry.html

$command_line = "convert -geometry $width" . "x" . "$height $image_path
$thumb_path";

system($command_line, $return_var);

if ($return_var == 1) {

echo "Thumbnail creation failed! :(";

} else {

echo "Thumbnail created. :) View
Thumbnail FFS";

}

?>

if you run into problems, and assuming imageMagick was successfully
installed:

- make sure you have write permission for where you want the thumbnail to be
created

- try replacing convert with the full path to the convert app.
e.g.
 $command_line = "/usr/bin/convert -geometry etc";

- run the script from the command line.  ssh in to your script's directory
and try typing this:

 php thumbscript.php

   you'll see verbose messages to help you pinpoint the problem. depending
on your setup, you might have to put in the full path to php

- if you're still stuck, try putting in this line:

wrote:

> This one time, at band camp, Stephen Alistoun 
> wrote:
>
>
> > I want all the images to resize to 100px width but the height adjusts
> > automatically.
>
>
> Two ways, GD or Imagick
>
> http://www.phpro.org/examples/GD-Thumbnail-Based-On-Image-Type.html
>
> http://www.phpro.org/tutorials/Imagick.html#4
>
> Kevin
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Crunchmutt Studios
Latest News Headlines: http://www.rssvideonews.com
http://www.imagepoop.com
http://www.crunchmutt.com
http://www.deadjoe.com
http://www.dailymedication.com
http://www.extremesportclips.com
http://www.coolanimalclips.com
http://www.robotclips.com
http://www.newsfinger.com
http://www.postyourimage.com
http://www.nakedalarmclock.com


Re: [PHP] Image Resizing

2008-12-21 Thread Kevin Waterson
This one time, at band camp, Stephen Alistoun  wrote:

 
> I want all the images to resize to 100px width but the height adjusts
> automatically.


Two ways, GD or Imagick

http://www.phpro.org/examples/GD-Thumbnail-Based-On-Image-Type.html

http://www.phpro.org/tutorials/Imagick.html#4

Kevin

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



Re: [PHP] Image Resizing

2008-12-20 Thread Ashley Sheridan
On Sat, 2008-12-20 at 20:59 +, Ólafur Waage wrote:

> With the built in functions (GD), you can read up on this function:
> http://is.php.net/manual/en/function.imagecopyresized.php
> If you have Imagick installed, you can read up on this:
> http://is.php.net/manual/en/function.imagick-thumbnailimage.php
> 
> On Sat, Dec 20, 2008 at 8:38 PM, Stephen Alistoun
>  wrote:
> >
> > Hi all,
> >
> > What is the best way in PHP to Resize an Image to a specific width.
> >
> > For Example I have images in the following sizes:
> >
> > (1) 200px width and 350px height
> > (2) 125px width and 220px height
> > (3) 166px width and 455px height
> >
> > I want all the images to resize to 100px width but the height adjusts
> > automatically.
> >
> > Regards,
> >
> > Stephen
> > --
> > View this message in context: 
> > http://www.nabble.com/Image-Resizing-tp21108753p21108753.html
> > Sent from the PHP - General mailing list archive at Nabble.com.
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 

RTFM

http://uk.php.net/manual/en/function.imagecopyresampled.php



Ash
www.ashleysheridan.co.uk


Re: [PHP] Image Resizing

2008-12-20 Thread Ólafur Waage
With the built in functions (GD), you can read up on this function:
http://is.php.net/manual/en/function.imagecopyresized.php
If you have Imagick installed, you can read up on this:
http://is.php.net/manual/en/function.imagick-thumbnailimage.php

On Sat, Dec 20, 2008 at 8:38 PM, Stephen Alistoun
 wrote:
>
> Hi all,
>
> What is the best way in PHP to Resize an Image to a specific width.
>
> For Example I have images in the following sizes:
>
> (1) 200px width and 350px height
> (2) 125px width and 220px height
> (3) 166px width and 455px height
>
> I want all the images to resize to 100px width but the height adjusts
> automatically.
>
> Regards,
>
> Stephen
> --
> View this message in context: 
> http://www.nabble.com/Image-Resizing-tp21108753p21108753.html
> Sent from the PHP - General mailing list archive at Nabble.com.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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



[PHP] Image Resizing

2008-12-20 Thread Stephen Alistoun

Hi all,

What is the best way in PHP to Resize an Image to a specific width.

For Example I have images in the following sizes:

(1) 200px width and 350px height
(2) 125px width and 220px height
(3) 166px width and 455px height

I want all the images to resize to 100px width but the height adjusts
automatically.

Regards,

Stephen
-- 
View this message in context: 
http://www.nabble.com/Image-Resizing-tp21108753p21108753.html
Sent from the PHP - General mailing list archive at Nabble.com.


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



Re: [PHP] Image Manipulation

2008-11-10 Thread tedd

At 7:16 PM -0500 11/9/08, Ron Piggott wrote:

Is there a way to find out the number of pixels wide and high an image
is in PHP?

Is there a way to resize an image using PHP?

Ron


Yes

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Image Manipulation

2008-11-09 Thread Jochem Maas
Ron Piggott schreef:
> Is there a way to find out the number of pixels wide and high an image
> is in PHP?
> 
> Is there a way to resize an image using PHP?

heh Ron, you've been around this list long enough to know that you
should STFW and RTFM before posting questions.

http://www.google.com/search?q=php+image+size

lo and behold the first result item.

the way it goes is like this, every time you think 'hey can I do that'
there is a very big chance some 12yo has already done it, blogged about it,
posted code on phpclasses.org (or some such place) and printed a T-Shirt
to celebrate the fact ... I know this from experience (not because I'm the
12yo .. although some might say so)

> 
> Ron
> 
> 


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



Re: [PHP] Image Manipulation

2008-11-09 Thread Ashley Sheridan
On Sun, 2008-11-09 at 19:16 -0500, Ron Piggott wrote:
> Is there a way to find out the number of pixels wide and high an image
> is in PHP?
> 
> Is there a way to resize an image using PHP?
> 
> Ron
> 
> 
Yes. Look at the PHP GD manual.


Ash
www.ashleysheridan.co.uk


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



[PHP] Image Manipulation

2008-11-09 Thread Ron Piggott
Is there a way to find out the number of pixels wide and high an image
is in PHP?

Is there a way to resize an image using PHP?

Ron


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



Re: [PHP] php image and javascript include

2008-09-14 Thread Ashley Sheridan
On Sun, 2008-09-14 at 10:23 +0200, Børge Holen wrote:
> On Saturday 13 September 2008 23:35:47 Ashley Sheridan wrote:
> > On Sat, 2008-09-13 at 23:24 +0200, Børge Holen wrote:
> > > On Saturday 13 September 2008 01:34:41 Ashley Sheridan wrote:
> > > > I've never been a huge fan of Vi or Vim, but I am a fan of coding in a
> > > > text editor, not a GUI, I just guess I prefer Kate. I know for certain
> > > > that one thing that really bugs me about Dreamweaver is the fact that
> > > > it has a tendency to really nerf up the spacing, and it replaces tabs
> > > > with spaces more often than not. It's all about the tabs to space
> > > > things out, adding spaces just makes the files bigger!
> > >
> > > Oh, thats just how you set up DW, options on indentations is througoutly
> > > documented inside the preferences pane and quite a few options to go,
> > > only thing that is wrong with it is the way it can't handle large
> > > projects, say like more than 100 files. nevermind the filesize...
> > >
> > > > Ash
> > > > www.ashleysheridan.co.uk
> > >
> > > --
> > > ---
> > > Børge Holen
> > > http://www.arivene.net
> >
> > I've worked on projects like that before, but never considered DW, I
> > used Notepad++ instead, as I was forced to use Windows at work at the
> > time. I never really had any reason to try to open all the files at once
> > though... ;)
> 
> Thats not what I was talking abount either,The tree view of project files 
> cannot handle many files before the waiting gets annoying
> 
> >
> >
> > Ash
> > www.ashleysheridan.co.uk
> 
> 
> 
> -- 
> ---
> Børge Holen
> http://www.arivene.net
> 
Tree view of a project, now there's an idea. Of course, real programmers
keep it all in their heads... Nah, I guess I've just not worked on
anything complex enough that I've needed the tree view yet. Mind you,
this new project I've been assigned to could well be going that way.
It's a mess of a system written in C# and it keeps crashing regularly to
boot. Somewhere along the line I think a sadist got involved in the
project, because it's really painful to work with sometimes...


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] php image and javascript include

2008-09-14 Thread Børge Holen
On Saturday 13 September 2008 23:35:47 Ashley Sheridan wrote:
> On Sat, 2008-09-13 at 23:24 +0200, Børge Holen wrote:
> > On Saturday 13 September 2008 01:34:41 Ashley Sheridan wrote:
> > > I've never been a huge fan of Vi or Vim, but I am a fan of coding in a
> > > text editor, not a GUI, I just guess I prefer Kate. I know for certain
> > > that one thing that really bugs me about Dreamweaver is the fact that
> > > it has a tendency to really nerf up the spacing, and it replaces tabs
> > > with spaces more often than not. It's all about the tabs to space
> > > things out, adding spaces just makes the files bigger!
> >
> > Oh, thats just how you set up DW, options on indentations is througoutly
> > documented inside the preferences pane and quite a few options to go,
> > only thing that is wrong with it is the way it can't handle large
> > projects, say like more than 100 files. nevermind the filesize...
> >
> > > Ash
> > > www.ashleysheridan.co.uk
> >
> > --
> > ---
> > Børge Holen
> > http://www.arivene.net
>
> I've worked on projects like that before, but never considered DW, I
> used Notepad++ instead, as I was forced to use Windows at work at the
> time. I never really had any reason to try to open all the files at once
> though... ;)

Thats not what I was talking abount either,The tree view of project files 
cannot handle many files before the waiting gets annoying

>
>
> Ash
> www.ashleysheridan.co.uk



-- 
---
Børge Holen
http://www.arivene.net

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



RE: [PHP] php image and javascript include

2008-09-13 Thread Tom Shaw
I'm a big fan of Zend Studio 5. It's pretty hard to beat considering how fast 
you can code load up the page refresh, and the editor itself is very clean plus 
it works in linux. I know a lot of people like to soft tab but I just don’t 
have the patience. Hard tabs all the way for me.

Tom Shaw
[EMAIL PROTECTED]

-Original Message-
From: Ashley Sheridan [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 13, 2008 4:36 PM
To: Børge Holen
Cc: php-general@lists.php.net
Subject: Re: [PHP] php image and javascript include

On Sat, 2008-09-13 at 23:24 +0200, Børge Holen wrote:
> On Saturday 13 September 2008 01:34:41 Ashley Sheridan wrote:
> > I've never been a huge fan of Vi or Vim, but I am a fan of coding in a
> > text editor, not a GUI, I just guess I prefer Kate. I know for certain
> > that one thing that really bugs me about Dreamweaver is the fact that it
> > has a tendency to really nerf up the spacing, and it replaces tabs with
> > spaces more often than not. It's all about the tabs to space things out,
> > adding spaces just makes the files bigger!
> 
> Oh, thats just how you set up DW, options on indentations is througoutly 
> documented inside the preferences pane and quite a few options to go, only 
> thing that is wrong with it is the way it can't handle large projects, say 
> like more than 100 files. nevermind the filesize...
> 
> >
> >
> > Ash
> > www.ashleysheridan.co.uk
> 
> 
> 
> -- 
> ---
> Børge Holen
> http://www.arivene.net
> 
I've worked on projects like that before, but never considered DW, I
used Notepad++ instead, as I was forced to use Windows at work at the
time. I never really had any reason to try to open all the files at once
though... ;)


Ash
www.ashleysheridan.co.uk


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


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



Re: [PHP] php image and javascript include

2008-09-13 Thread Ashley Sheridan
On Sat, 2008-09-13 at 23:24 +0200, Børge Holen wrote:
> On Saturday 13 September 2008 01:34:41 Ashley Sheridan wrote:
> > I've never been a huge fan of Vi or Vim, but I am a fan of coding in a
> > text editor, not a GUI, I just guess I prefer Kate. I know for certain
> > that one thing that really bugs me about Dreamweaver is the fact that it
> > has a tendency to really nerf up the spacing, and it replaces tabs with
> > spaces more often than not. It's all about the tabs to space things out,
> > adding spaces just makes the files bigger!
> 
> Oh, thats just how you set up DW, options on indentations is througoutly 
> documented inside the preferences pane and quite a few options to go, only 
> thing that is wrong with it is the way it can't handle large projects, say 
> like more than 100 files. nevermind the filesize...
> 
> >
> >
> > Ash
> > www.ashleysheridan.co.uk
> 
> 
> 
> -- 
> ---
> Børge Holen
> http://www.arivene.net
> 
I've worked on projects like that before, but never considered DW, I
used Notepad++ instead, as I was forced to use Windows at work at the
time. I never really had any reason to try to open all the files at once
though... ;)


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] php image and javascript include

2008-09-13 Thread Børge Holen
On Saturday 13 September 2008 01:34:41 Ashley Sheridan wrote:
> I've never been a huge fan of Vi or Vim, but I am a fan of coding in a
> text editor, not a GUI, I just guess I prefer Kate. I know for certain
> that one thing that really bugs me about Dreamweaver is the fact that it
> has a tendency to really nerf up the spacing, and it replaces tabs with
> spaces more often than not. It's all about the tabs to space things out,
> adding spaces just makes the files bigger!

Oh, thats just how you set up DW, options on indentations is througoutly 
documented inside the preferences pane and quite a few options to go, only 
thing that is wrong with it is the way it can't handle large projects, say 
like more than 100 files. nevermind the filesize...

>
>
> Ash
> www.ashleysheridan.co.uk



-- 
---
Børge Holen
http://www.arivene.net

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



Re: [PHP] php image and javascript include

2008-09-12 Thread Ashley Sheridan
I've never been a huge fan of Vi or Vim, but I am a fan of coding in a
text editor, not a GUI, I just guess I prefer Kate. I know for certain
that one thing that really bugs me about Dreamweaver is the fact that it
has a tendency to really nerf up the spacing, and it replaces tabs with
spaces more often than not. It's all about the tabs to space things out,
adding spaces just makes the files bigger!


Ash
www.ashleysheridan.co.uk
--- Begin Message ---
On Fri, 2008-09-12 at 15:11 +0200, Børge Holen wrote:
> On Friday 12 September 2008 12:02:13 you wrote:
> > there's three letters
> >
> > VIM!
> 
> yes and amiga still kicks ass. The old fashioned way works, ok. But ... after 
> a while, you still do the same old thing the same old way, while everything 
> passes you by. I love vim for reading and editing a file here or there, make 
> a script to do some backup there, shortcuts for doing a lot of small thing.
> Still I draw a line when having to do projects with more than a few files, 
> there are new and better ways.
> But your not that far off, I feel sorry for those guys still thinking nano 
> and 
> joe is the world ;D

Keep your pity, I'm in no need of it :)

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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

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

Re: [PHP] php image and javascript include

2008-09-12 Thread Robert Cummings
On Fri, 2008-09-12 at 15:11 +0200, Børge Holen wrote:
> On Friday 12 September 2008 12:02:13 you wrote:
> > there's three letters
> >
> > VIM!
> 
> yes and amiga still kicks ass. The old fashioned way works, ok. But ... after 
> a while, you still do the same old thing the same old way, while everything 
> passes you by. I love vim for reading and editing a file here or there, make 
> a script to do some backup there, shortcuts for doing a lot of small thing.
> Still I draw a line when having to do projects with more than a few files, 
> there are new and better ways.
> But your not that far off, I feel sorry for those guys still thinking nano 
> and 
> joe is the world ;D

Keep your pity, I'm in no need of it :)

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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



Re: [PHP] php image and javascript include

2008-09-12 Thread Børge Holen
On Friday 12 September 2008 12:02:13 you wrote:
> there's three letters
>
> VIM!

yes and amiga still kicks ass. The old fashioned way works, ok. But ... after 
a while, you still do the same old thing the same old way, while everything 
passes you by. I love vim for reading and editing a file here or there, make 
a script to do some backup there, shortcuts for doing a lot of small thing.
Still I draw a line when having to do projects with more than a few files, 
there are new and better ways.
But your not that far off, I feel sorry for those guys still thinking nano and 
joe is the world ;D

>
> You can make that do most anything if you trawl the scripts site. . .
>
> 2008/9/9 Ashley Sheridan <[EMAIL PROTECTED]>
>
> > Kate has an auto text feature, and you can set it to start prompting
> > from typing in as few characters as you wish, although it only prompts
> > for things you've already typed, it this does save you from making
> > obvious variable name typos as it will prompt the next time you try to
> > use it, and it recognises many, many more languages than DW.
> >
> > If you're just after the code view, Dreamweaver is a little heavy, and
> > it runs on an OS which is also a bit heavy, but that's for another
> > discussion!
> >
> >
> > Ash
> > www.ashleysheridan.co.uk
> >
> >
> > -- Forwarded message ------
> > From: Børge Holen <[EMAIL PROTECTED]>
> > To: php-general@lists.php.net
> > Date: Mon, 08 Sep 2008 14:57:34 +0200
> > Subject: Re: [PHP] php image and javascript include
> >
> > On Monday 08 September 2008 14:53:24 Jay Moore wrote:
> > > > Dreamweaver? Eclipse? Pah, it's all about using a text editor! Kate
> > > > (on KDE) is my preference ;)
> > >
> > > Heathen!
> > >
> > > Dreamweaver is awesome.  Not for their WYSIWYG editor, but for their
> > > code-only view and its auto-complete.
> > >
> > > Never have I typed so little to get so... little.
> >
> > I thought so to, till I tried quanta+
> >
> > > Jay
> >
> > --
> > ---
> > Børge Holen
> > http://www.arivene.net
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php



-- 
---
Børge Holen
http://www.arivene.net

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



Re: [PHP] php image and javascript include

2008-09-12 Thread Luke
there's three letters

VIM!

You can make that do most anything if you trawl the scripts site. . .

2008/9/9 Ashley Sheridan <[EMAIL PROTECTED]>

> Kate has an auto text feature, and you can set it to start prompting
> from typing in as few characters as you wish, although it only prompts
> for things you've already typed, it this does save you from making
> obvious variable name typos as it will prompt the next time you try to
> use it, and it recognises many, many more languages than DW.
>
> If you're just after the code view, Dreamweaver is a little heavy, and
> it runs on an OS which is also a bit heavy, but that's for another
> discussion!
>
>
> Ash
> www.ashleysheridan.co.uk
>
>
> -- Forwarded message --
> From: Børge Holen <[EMAIL PROTECTED]>
> To: php-general@lists.php.net
> Date: Mon, 08 Sep 2008 14:57:34 +0200
> Subject: Re: [PHP] php image and javascript include
> On Monday 08 September 2008 14:53:24 Jay Moore wrote:
> > > Dreamweaver? Eclipse? Pah, it's all about using a text editor! Kate (on
> > > KDE) is my preference ;)
> >
> > Heathen!
> >
> > Dreamweaver is awesome.  Not for their WYSIWYG editor, but for their
> > code-only view and its auto-complete.
> >
> > Never have I typed so little to get so... little.
>
> I thought so to, till I tried quanta+
>
> >
> > Jay
>
>
>
> --
> ---
> Børge Holen
> http://www.arivene.net
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



-- 
Luke Slater


Re: [PHP] php image and javascript include

2008-09-09 Thread Ashley Sheridan
Kate has an auto text feature, and you can set it to start prompting
from typing in as few characters as you wish, although it only prompts
for things you've already typed, it this does save you from making
obvious variable name typos as it will prompt the next time you try to
use it, and it recognises many, many more languages than DW.

If you're just after the code view, Dreamweaver is a little heavy, and
it runs on an OS which is also a bit heavy, but that's for another
discussion! 


Ash
www.ashleysheridan.co.uk
--- Begin Message ---
On Monday 08 September 2008 14:53:24 Jay Moore wrote:
> > Dreamweaver? Eclipse? Pah, it's all about using a text editor! Kate (on
> > KDE) is my preference ;)
>
> Heathen!
>
> Dreamweaver is awesome.  Not for their WYSIWYG editor, but for their
> code-only view and its auto-complete.
>
> Never have I typed so little to get so... little.

I thought so to, till I tried quanta+

>
> Jay



-- 
---
Børge Holen
http://www.arivene.net

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

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

Re: [PHP] php image & javascript issue

2008-09-08 Thread javasac

In my test.php file, I cannot run javascript and images do not show up. If I
run this file using the URL
http://localhost/index/?m=login&name=Sachin

I can see 'My name is Sachin'. 

If I rename this file to test.html and open it, the image shows up and
clicking on 'Click Me!' button works fine.
Pls uncomment the   tag when you run it.

===




SPIDR

















===

test.js

function Hello()
{
alert('Hello Ronaldo');
}

==




-- 
View this message in context: 
http://www.nabble.com/php-image---javascript-issue-tp19376008p19376099.html
Sent from the PHP - General mailing list archive at Nabble.com.


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



[PHP] php image & javascript issue

2008-09-08 Thread javasac

In my test.php file, I cannot run javascript and images do ot show up. If I
run this file using the URL
http://localhost/index/?m=login&name=Sachin

I can see 'My name is Sachin'. 

If I rename this file to test.html and open it, the image shows up and
clicking on 'Click Me!' button works 
http://www.nabble.com/file/p19376008/login.png fine.

===




SPIDR







 login.png 








===

test.js

function Hello()
{
alert('Hello Ronaldo');
}

==


-- 
View this message in context: 
http://www.nabble.com/php-image---javascript-issue-tp19376008p19376008.html
Sent from the PHP - General mailing list archive at Nabble.com.


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



Re: [PHP] php image and javascript include

2008-09-08 Thread Børge Holen
On Monday 08 September 2008 14:53:24 Jay Moore wrote:
> > Dreamweaver? Eclipse? Pah, it's all about using a text editor! Kate (on
> > KDE) is my preference ;)
>
> Heathen!
>
> Dreamweaver is awesome.  Not for their WYSIWYG editor, but for their
> code-only view and its auto-complete.
>
> Never have I typed so little to get so... little.

I thought so to, till I tried quanta+

>
> Jay



-- 
---
Børge Holen
http://www.arivene.net

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



Re: [PHP] php image and javascript include

2008-09-08 Thread Jay Moore

Dreamweaver? Eclipse? Pah, it's all about using a text editor! Kate (on
KDE) is my preference ;)


Heathen!

Dreamweaver is awesome.  Not for their WYSIWYG editor, but for their 
code-only view and its auto-complete.


Never have I typed so little to get so... little.

Jay

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



Re: [PHP] php image and javascript include

2008-09-07 Thread Ashley Sheridan
Dreamweaver? Eclipse? Pah, it's all about using a text editor! Kate (on
KDE) is my preference ;)


Ash
www.ashleysheridan.co.uk
--- Begin Message ---

Reese schreef:

b wrote:

javasac wrote:

[lots of stuff ...]


Second, at least one of the image paths is relative to your own 
desktop computer's drive (why is it that this always happens on a 
Windows box?)


 > 
 > C:/wamp/www/yojoe-web/html/site/images/box_top_rht.jpg 


PEBKAC error? I've seen it happen when an inexperienced developer
copied a file to another location, from within Dreamweaver, on a
Mac. Dreamweaver updates the file path(s) if permitted and depending
on a couple of variables, puts in an absolute path to the location
on that particular machine.


at the opposite end of the stick you have Eclipse users (mac or otherwise)
whose machines freeze up when moving or renaming stuff as Eclipse tries to
refactor code that references the resource. It's no wonder that dreamweaver
screws such stuff up ... with Eclipse you seem to have to sell your soul in
order get the arcane settings related to these kinds of 'productivity' tools
even close to working.

mines the one with 'not for sale' on the back.


Reese





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


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

Re: [PHP] php image and javascript include

2008-09-07 Thread Jochem Maas

Reese schreef:

b wrote:

javasac wrote:

[lots of stuff ...]


Second, at least one of the image paths is relative to your own 
desktop computer's drive (why is it that this always happens on a 
Windows box?)


 > 
 > C:/wamp/www/yojoe-web/html/site/images/box_top_rht.jpg 


PEBKAC error? I've seen it happen when an inexperienced developer
copied a file to another location, from within Dreamweaver, on a
Mac. Dreamweaver updates the file path(s) if permitted and depending
on a couple of variables, puts in an absolute path to the location
on that particular machine.


at the opposite end of the stick you have Eclipse users (mac or otherwise)
whose machines freeze up when moving or renaming stuff as Eclipse tries to
refactor code that references the resource. It's no wonder that dreamweaver
screws such stuff up ... with Eclipse you seem to have to sell your soul in
order get the arcane settings related to these kinds of 'productivity' tools
even close to working.

mines the one with 'not for sale' on the back.


Reese





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



Re: [PHP] php image and javascript include

2008-09-07 Thread Reese

b wrote:

javasac wrote:

[lots of stuff ...]


Second, at least one of the image paths is relative to your own desktop 
computer's drive (why is it that this always happens on a Windows box?)


 > 
 > C:/wamp/www/yojoe-web/html/site/images/box_top_rht.jpg 


PEBKAC error? I've seen it happen when an inexperienced developer
copied a file to another location, from within Dreamweaver, on a
Mac. Dreamweaver updates the file path(s) if permitted and depending
on a couple of variables, puts in an absolute path to the location
on that particular machine.

Reese


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



Re: [PHP] php image and javascript include

2008-09-07 Thread b

javasac wrote:

[lots of stuff ...]



I'm guessing that was the *output* of the PHP file, not the script itself.

You've got a couple different errors here. The first is that you're not 
creating img tags. All you have here is the path to the image. A browser 
isn't going to do anything with that.


> 
> images/box_bottom_lft.jpg 

Second, at least one of the image paths is relative to your own desktop 
computer's drive (why is it that this always happens on a Windows box?)


> 
> C:/wamp/www/yojoe-web/html/site/images/box_top_rht.jpg 


Also, in the future, it'd be better to trim out the completely 
unnecessary bits. That's an awful lot of (bloated) HTML and javascript 
to wade through.


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



Re: [PHP] php image and javascript include

2008-09-07 Thread Ashley Sheridan
   


  
By checking the box, you confirm that :



   images/reset.jpg  images/signin.jpg



   
   
   



images/box_rht.jpg 
  
  

images/box_bottom_lft.jpg 
 images/box_bottom_mid.jpg 
 images/box_bottom_rht.jpg 
  


  

  
Log In
  Sign
Up! 
  
  



  
  
User Id : 



  
  
Password : 



  
  
 
 
 
  
  

  Remember Me 
 # 
images/login.png     
  
  
 
 # Forgot your password?   
  

  



   
  

   
           
  
  






-- 
View this message in context: 
http://www.nabble.com/php-image-and-javascript-include-tp19357706p19360501.html
Sent from the PHP - General mailing list archive at Nabble.com.


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


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

Re: [PHP] php image and javascript include

2008-09-07 Thread Reese

javasac wrote:



Where is the PHP? There's nothing between  tags. Nothing
between PHP short tags (  ), either.

Reese


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



Re: [PHP] php image and javascript include

2008-09-07 Thread Stut

On 7 Sep 2008, at 18:35, javasac wrote:




I see no PHP in there. Please post the piece of PHP code you're having  
a problem with.


-Stut

--
http://stut.net/

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



Re: [PHP] php image and javascript include

2008-09-07 Thread javasac
By checking the box, you confirm that :



   images/reset.jpg  images/signin.jpg



   
   
   



images/box_rht.jpg 
  
  

images/box_bottom_lft.jpg 
 images/box_bottom_mid.jpg 
 images/box_bottom_rht.jpg 
  


  

  
Log In
  Sign
Up! 
  
  



  
  
User Id : 



  
  
Password : 



  
  
 
 
 
  
  

  Remember Me 
 # 
images/login.png     
  
  
 
 # Forgot your password?   
  

  



   
  

   
       
  
  






-- 
View this message in context: 
http://www.nabble.com/php-image-and-javascript-include-tp19357706p19360501.html
Sent from the PHP - General mailing list archive at Nabble.com.


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



Re: [PHP] php image and javascript include

2008-09-07 Thread javasac

Thanks for the reply. here is the php file.
I am using wamp server 2.0 http://www.nabble.com/file/p19360339/signin.jpg
signin.jpg 



Ashley Sheridan-3 wrote:
> 
> Do you have an excerpt of the PHP code you have preceeding the HTML you
> are using to include the JavaScript & images?
> 
> 
> Ash
> www.ashleysheridan.co.uk
> 
> 
> Hi All,
> 
> Strange issue here. I m including images and javascript in my php file.
> None
> of them show/work up.
> If i change the .php file to .html, both thing start working. So no issues
> with path and all.
> 
> Any idea?
> 
> Thanks,
> Sachin
> -- 
> View this message in context:
> http://www.nabble.com/php-image-and-javascript-include-tp19357706p19357706.html
> Sent from the PHP - General mailing list archive at Nabble.com.
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
http://www.nabble.com/file/p19360339/signup.php signup.php 
-- 
View this message in context: 
http://www.nabble.com/php-image-and-javascript-include-tp19357706p19360339.html
Sent from the PHP - General mailing list archive at Nabble.com.


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



Re: [PHP] php image and javascript include

2008-09-07 Thread Ashley Sheridan
Do you have an excerpt of the PHP code you have preceeding the HTML you
are using to include the JavaScript & images?


Ash
www.ashleysheridan.co.uk
--- Begin Message ---

Hi All,

Strange issue here. I m including images and javascript in my php file. None
of them show/work up.
If i change the .php file to .html, both thing start working. So no issues
with path and all.

Any idea?

Thanks,
Sachin
-- 
View this message in context: 
http://www.nabble.com/php-image-and-javascript-include-tp19357706p19357706.html
Sent from the PHP - General mailing list archive at Nabble.com.


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


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

[PHP] php image and javascript include

2008-09-07 Thread javasac

Hi All,

Strange issue here. I m including images and javascript in my php file. None
of them show/work up.
If i change the .php file to .html, both thing start working. So no issues
with path and all.

Any idea?

Thanks,
Sachin
-- 
View this message in context: 
http://www.nabble.com/php-image-and-javascript-include-tp19357706p19357706.html
Sent from the PHP - General mailing list archive at Nabble.com.


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



Re: Re: [PHP] Image Generation

2008-08-20 Thread Ashley Sheridan
Hi Alex,

I did reply to this, but it apparently didn't get to you. You will need
to create a separate image with the text in, as GD offers no function to
create text already stretched (actually, it's text offerings are sparse
to say the least). You can create this image in memory if you are
worrying about creating a lot of files on your server though, and then
perform resizing operations on the image in memory.

Ash
www.ashleysheridan.co.uk
--- Begin Message ---
  BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; } 
 Just to clarify some points, there is no need for this to be of
print quality - it is an online representation of the vinyl they will
recieve in the post. 

Also, the main problem I've got with GD, is generating text that is
stretched? Do I need to generate a text image then stretch this using
normal resize functions?? 

Alex
 On Wed , Jochem Maas [EMAIL PROTECTED] sent:
  Ashley Sheridan schreef: 
 > Hence me saying "in the way you are asking" I know GD can scale
images 
 > (I've done that myself on more than one occassion), but not images
that 
 > are intended for print as opposed to screen viewing, as this
appears to be. 
 I can't see how imagemagick helps here, it's a bitmap manipulator
just like 
 GD. so it's either use something that generates vector based output
(and let 
 the printersubsytem handle the conversion) or generate massive
bitmaps and 
 print them at a very high DPI. 
 > 
 > As for quality, I've found that GD offers comparable quality
images to 
 > ImageMagik, and in better time more often than not. The main
advantage 
 > ImageMagik has is with functionality; quite simply, it can do much
more 
 > than GD and GD2. 
 I'll take your word on that, I've never played with imagemagick,
having found 
 GD to produce quality good enough for my needs. 
 > 
 > Ash 
 > www.ashleysheridan.co.uk [1] 
 > 
 > 
 >
--------

 > 
 > Onderwerp: 
 > Re: [PHP] Image Generation 
 > Van: 
 > Jochem Maas  
 > Datum: 
 > Wed, 20 Aug 2008 11:06:14 +0200 
 > Aan: 
 > [EMAIL PROTECTED] [3] 
 > 
 > Aan: 
 > [EMAIL PROTECTED] [4] 
 > CC: 
 > Alex Chamberlain , PHP General list 
 >  
 > 
 > Return-path: 
 > 

[EMAIL PROTECTED]> 
 > Envelope-to: 
 > [EMAIL PROTECTED] [7] 
 > Delivery-date: 
 > Wed, 20 Aug 2008 10:06:54 +0100 
 > Received: 
 > from [216.92.131.4] (port=19732 helo=lists.php.net) by 
 > zencphosting11.zen.co.uk with esmtp (Exim 4.68) (envelope-from 
 > 

[EMAIL PROTECTED]>) id 
 > 1KVjeX-0001J1-OZ for [EMAIL PROTECTED] [8]; Wed, 20 Aug
2008 10:06:54 
 > +0100 
 > X-Host-Fingerprint: 
 > 216.92.131.4 lists.php.net 
 > Received: 
 > from [216.92.131.4] ([216.92.131.4:19612] helo=lists.php.net) by 
 > pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 
 > 54/0E-51571-CAEDBA84 for ; Wed, 20 Aug 2008 
 > 05:06:52 -0400 
 > Received: 
 > (qmail 38571 invoked by uid 1010); 20 Aug 2008 09:06:34 - 
 > Mailing-List: 
 > contact [EMAIL PROTECTED] [10]; run by ezmlm 
 > Precedence: 
 > bulk 
 > list-help: 
 >  
 > list-unsubscribe: 
 >  
 > list-post: 
 >  
 > Delivered-To: 
 > mailing list php-general@lists.php.net [14] 
 > Received: 
 > (qmail 38564 invoked from network); 20 Aug 2008 09:06:34 - 
 > Authentication-Results: 
 > pb1.pair.com [EMAIL PROTECTED] [15];
sender-id=unknown 
 > Authentication-Results: 
 > pb1.pair.com [EMAIL PROTECTED] [16]; spf=permerror; 
 > sender-id=unknown 
 > Received-SPF: 
 > error (pb1.pair.com: domain iamjochem.com from 194.109.193.121
cause and 
 > error) 
 > X-PHP-List-Original-Sender: 
 > [EMAIL PROTECTED] [17] 
 > X-Host-Fingerprint: 
 > 194.109.193.121 mx1.moulin.nl Linux 2.6 
 > X-Virus-Scanned: 
 > amavisd-new at moulin.nl 
 > Bericht-ID: 
 >  
 > User-agent: 
 > Thunderbird 2.0.0.16 (Macintosh/20080707) 
 > MIME-versie: 
 > 1.0 
 > Referenties: 
 >  
 >  
 > In-Reply-To: 
 >  
 > X-Enigmail-Version: 
 > 0.95.6 
 > Content-Type: 
 > text/plain; charset=UTF-8; format=flowed 
 > Content-Transfer-Encoding: 
 > base64 
 > 
 > 
 > Ashley Sheridan schreef: 
 >> I don't think GD has a built-in function to scale an image the
way you 
 >> are asking, 
 > 
 > of course you can scale images with GD, but everything works in
pixels, 
 > ImageMagick is no different ... there is no such thing as
millimeters 
 > when it 
 > comes to bitmap images, you can specify an output resolution when 
 > printing but 
 > that has no direct bearing on the image file itself. 
 > 
 > Alex will have to figure out the bounding box ratios of the
dimensions 
 > g

Re: Re: [PHP] Image Generation

2008-08-20 Thread Ashley Sheridan
Yes, if you wish to stretch text in this way then you will have to
create the image and stretch. You can create the image in memory and
perform the stretching on it there if you are worried about writing too
many temporary images to the server.

Ash
www.ashleysheridan.co.uk
--- Begin Message ---
  BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; } 
 Just to clarify some points, there is no need for this to be of
print quality - it is an online representation of the vinyl they will
recieve in the post. 

Also, the main problem I've got with GD, is generating text that is
stretched? Do I need to generate a text image then stretch this using
normal resize functions?? 

Alex
 On Wed , Jochem Maas [EMAIL PROTECTED] sent:
  Ashley Sheridan schreef: 
 > Hence me saying "in the way you are asking" I know GD can scale
images 
 > (I've done that myself on more than one occassion), but not images
that 
 > are intended for print as opposed to screen viewing, as this
appears to be. 
 I can't see how imagemagick helps here, it's a bitmap manipulator
just like 
 GD. so it's either use something that generates vector based output
(and let 
 the printersubsytem handle the conversion) or generate massive
bitmaps and 
 print them at a very high DPI. 
 > 
 > As for quality, I've found that GD offers comparable quality
images to 
 > ImageMagik, and in better time more often than not. The main
advantage 
 > ImageMagik has is with functionality; quite simply, it can do much
more 
 > than GD and GD2. 
 I'll take your word on that, I've never played with imagemagick,
having found 
 GD to produce quality good enough for my needs. 
 > 
 > Ash 
 > www.ashleysheridan.co.uk [1] 
 > 
 > 
 >
--------

 > 
 > Onderwerp: 
 > Re: [PHP] Image Generation 
 > Van: 
 > Jochem Maas  
 > Datum: 
 > Wed, 20 Aug 2008 11:06:14 +0200 
 > Aan: 
 > [EMAIL PROTECTED] [3] 
 > 
 > Aan: 
 > [EMAIL PROTECTED] [4] 
 > CC: 
 > Alex Chamberlain , PHP General list 
 >  
 > 
 > Return-path: 
 > 

[EMAIL PROTECTED]> 
 > Envelope-to: 
 > [EMAIL PROTECTED] [7] 
 > Delivery-date: 
 > Wed, 20 Aug 2008 10:06:54 +0100 
 > Received: 
 > from [216.92.131.4] (port=19732 helo=lists.php.net) by 
 > zencphosting11.zen.co.uk with esmtp (Exim 4.68) (envelope-from 
 > 

[EMAIL PROTECTED]>) id 
 > 1KVjeX-0001J1-OZ for [EMAIL PROTECTED] [8]; Wed, 20 Aug
2008 10:06:54 
 > +0100 
 > X-Host-Fingerprint: 
 > 216.92.131.4 lists.php.net 
 > Received: 
 > from [216.92.131.4] ([216.92.131.4:19612] helo=lists.php.net) by 
 > pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 
 > 54/0E-51571-CAEDBA84 for ; Wed, 20 Aug 2008 
 > 05:06:52 -0400 
 > Received: 
 > (qmail 38571 invoked by uid 1010); 20 Aug 2008 09:06:34 - 
 > Mailing-List: 
 > contact [EMAIL PROTECTED] [10]; run by ezmlm 
 > Precedence: 
 > bulk 
 > list-help: 
 >  
 > list-unsubscribe: 
 >  
 > list-post: 
 >  
 > Delivered-To: 
 > mailing list php-general@lists.php.net [14] 
 > Received: 
 > (qmail 38564 invoked from network); 20 Aug 2008 09:06:34 - 
 > Authentication-Results: 
 > pb1.pair.com [EMAIL PROTECTED] [15];
sender-id=unknown 
 > Authentication-Results: 
 > pb1.pair.com [EMAIL PROTECTED] [16]; spf=permerror; 
 > sender-id=unknown 
 > Received-SPF: 
 > error (pb1.pair.com: domain iamjochem.com from 194.109.193.121
cause and 
 > error) 
 > X-PHP-List-Original-Sender: 
 > [EMAIL PROTECTED] [17] 
 > X-Host-Fingerprint: 
 > 194.109.193.121 mx1.moulin.nl Linux 2.6 
 > X-Virus-Scanned: 
 > amavisd-new at moulin.nl 
 > Bericht-ID: 
 >  
 > User-agent: 
 > Thunderbird 2.0.0.16 (Macintosh/20080707) 
 > MIME-versie: 
 > 1.0 
 > Referenties: 
 >  
 >  
 > In-Reply-To: 
 >  
 > X-Enigmail-Version: 
 > 0.95.6 
 > Content-Type: 
 > text/plain; charset=UTF-8; format=flowed 
 > Content-Transfer-Encoding: 
 > base64 
 > 
 > 
 > Ashley Sheridan schreef: 
 >> I don't think GD has a built-in function to scale an image the
way you 
 >> are asking, 
 > 
 > of course you can scale images with GD, but everything works in
pixels, 
 > ImageMagick is no different ... there is no such thing as
millimeters 
 > when it 
 > comes to bitmap images, you can specify an output resolution when 
 > printing but 
 > that has no direct bearing on the image file itself. 
 > 
 > Alex will have to figure out the bounding box ratios of the
dimensions 
 > given in 
 > mm and transpose that into the 300x150 pixel image he's going to
use as 
 > a canvas, 
 > the math is not that hard (can't be if I can manage it!) and
alth

Re: Re: [PHP] Image Generation

2008-08-20 Thread php
  BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; } 
 Just to clarify some points, there is no need for this to be of
print quality - it is an online representation of the vinyl they will
recieve in the post. 

Also, the main problem I've got with GD, is generating text that is
stretched? Do I need to generate a text image then stretch this using
normal resize functions?? 

Alex
 On Wed , Jochem Maas [EMAIL PROTECTED] sent:
  Ashley Sheridan schreef: 
 > Hence me saying "in the way you are asking" I know GD can scale
images 
 > (I've done that myself on more than one occassion), but not images
that 
 > are intended for print as opposed to screen viewing, as this
appears to be. 
 I can't see how imagemagick helps here, it's a bitmap manipulator
just like 
 GD. so it's either use something that generates vector based output
(and let 
 the printersubsytem handle the conversion) or generate massive
bitmaps and 
 print them at a very high DPI. 
 > 
 > As for quality, I've found that GD offers comparable quality
images to 
 > ImageMagik, and in better time more often than not. The main
advantage 
 > ImageMagik has is with functionality; quite simply, it can do much
more 
 > than GD and GD2. 
 I'll take your word on that, I've never played with imagemagick,
having found 
 GD to produce quality good enough for my needs. 
 > 
 > Ash 
 > www.ashleysheridan.co.uk [1] 
 > 
 > 
 >
--------

 > 
 > Onderwerp: 
 > Re: [PHP] Image Generation 
 > Van: 
 > Jochem Maas  
 > Datum: 
 > Wed, 20 Aug 2008 11:06:14 +0200 
 > Aan: 
 > [EMAIL PROTECTED] [3] 
 > 
 > Aan: 
 > [EMAIL PROTECTED] [4] 
 > CC: 
 > Alex Chamberlain , PHP General list 
 >  
 > 
 > Return-path: 
 > 

[EMAIL PROTECTED]> 
 > Envelope-to: 
 > [EMAIL PROTECTED] [7] 
 > Delivery-date: 
 > Wed, 20 Aug 2008 10:06:54 +0100 
 > Received: 
 > from [216.92.131.4] (port=19732 helo=lists.php.net) by 
 > zencphosting11.zen.co.uk with esmtp (Exim 4.68) (envelope-from 
 > 

[EMAIL PROTECTED]>) id 
 > 1KVjeX-0001J1-OZ for [EMAIL PROTECTED] [8]; Wed, 20 Aug
2008 10:06:54 
 > +0100 
 > X-Host-Fingerprint: 
 > 216.92.131.4 lists.php.net 
 > Received: 
 > from [216.92.131.4] ([216.92.131.4:19612] helo=lists.php.net) by 
 > pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 
 > 54/0E-51571-CAEDBA84 for ; Wed, 20 Aug 2008 
 > 05:06:52 -0400 
 > Received: 
 > (qmail 38571 invoked by uid 1010); 20 Aug 2008 09:06:34 - 
 > Mailing-List: 
 > contact [EMAIL PROTECTED] [10]; run by ezmlm 
 > Precedence: 
 > bulk 
 > list-help: 
 >  
 > list-unsubscribe: 
 >  
 > list-post: 
 >  
 > Delivered-To: 
 > mailing list php-general@lists.php.net [14] 
 > Received: 
 > (qmail 38564 invoked from network); 20 Aug 2008 09:06:34 - 
 > Authentication-Results: 
 > pb1.pair.com [EMAIL PROTECTED] [15];
sender-id=unknown 
 > Authentication-Results: 
 > pb1.pair.com [EMAIL PROTECTED] [16]; spf=permerror; 
 > sender-id=unknown 
 > Received-SPF: 
 > error (pb1.pair.com: domain iamjochem.com from 194.109.193.121
cause and 
 > error) 
 > X-PHP-List-Original-Sender: 
 > [EMAIL PROTECTED] [17] 
 > X-Host-Fingerprint: 
 > 194.109.193.121 mx1.moulin.nl Linux 2.6 
 > X-Virus-Scanned: 
 > amavisd-new at moulin.nl 
 > Bericht-ID: 
 >  
 > User-agent: 
 > Thunderbird 2.0.0.16 (Macintosh/20080707) 
 > MIME-versie: 
 > 1.0 
 > Referenties: 
 >  
 >  
 > In-Reply-To: 
 >  
 > X-Enigmail-Version: 
 > 0.95.6 
 > Content-Type: 
 > text/plain; charset=UTF-8; format=flowed 
 > Content-Transfer-Encoding: 
 > base64 
 > 
 > 
 > Ashley Sheridan schreef: 
 >> I don't think GD has a built-in function to scale an image the
way you 
 >> are asking, 
 > 
 > of course you can scale images with GD, but everything works in
pixels, 
 > ImageMagick is no different ... there is no such thing as
millimeters 
 > when it 
 > comes to bitmap images, you can specify an output resolution when 
 > printing but 
 > that has no direct bearing on the image file itself. 
 > 
 > Alex will have to figure out the bounding box ratios of the
dimensions 
 > given in 
 > mm and transpose that into the 300x150 pixel image he's going to
use as 
 > a canvas, 
 > the math is not that hard (can't be if I can manage it!) and
although it 
 > won't 
 > be a perfect at all times he did mention it's a representation. 
 > 
 > If Alex requires pixel perfect representation of print output in a
file 
 > then he 
 > is going to have to resort to some kind of vector based image 
 > representation 
 &g

Re: [PHP] Image Generation

2008-08-20 Thread Jochem Maas

Ashley Sheridan schreef:
Hence me saying "in the way you are asking" I know GD can scale images 
(I've done that myself on more than one occassion), but not images that 
are intended for print as opposed to screen viewing, as this appears to be.


I can't see how imagemagick helps here, it's a bitmap manipulator just like
GD. so it's either use something that generates vector based output (and let
the printersubsytem handle the conversion) or generate massive bitmaps and
print them at a very high DPI.



As for quality, I've found that GD offers comparable quality images to 
ImageMagik, and in better time more often than not. The main advantage 
ImageMagik has is with functionality; quite simply, it can do much more 
than GD and GD2.


I'll take your word on that, I've never played with imagemagick, having found
GD to produce quality good enough for my needs.



Ash
www.ashleysheridan.co.uk


--------

Onderwerp:
Re: [PHP] Image Generation
Van:
Jochem Maas <[EMAIL PROTECTED]>
Datum:
Wed, 20 Aug 2008 11:06:14 +0200
Aan:
[EMAIL PROTECTED]

Aan:
[EMAIL PROTECTED]
CC:
Alex Chamberlain <[EMAIL PROTECTED]>, PHP General list 



Return-path:
<[EMAIL PROTECTED]>
Envelope-to:
[EMAIL PROTECTED]
Delivery-date:
Wed, 20 Aug 2008 10:06:54 +0100
Received:
from [216.92.131.4] (port=19732 helo=lists.php.net) by 
zencphosting11.zen.co.uk with esmtp (Exim 4.68) (envelope-from 
<[EMAIL PROTECTED]>) id 
1KVjeX-0001J1-OZ for [EMAIL PROTECTED]; Wed, 20 Aug 2008 10:06:54 
+0100

X-Host-Fingerprint:
216.92.131.4 lists.php.net
Received:
from [216.92.131.4] ([216.92.131.4:19612] helo=lists.php.net) by 
pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 
54/0E-51571-CAEDBA84 for <[EMAIL PROTECTED]>; Wed, 20 Aug 2008 
05:06:52 -0400

Received:
(qmail 38571 invoked by uid 1010); 20 Aug 2008 09:06:34 -
Mailing-List:
contact [EMAIL PROTECTED]; run by ezmlm
Precedence:
bulk
list-help:
<mailto:[EMAIL PROTECTED]>
list-unsubscribe:
<mailto:[EMAIL PROTECTED]>
list-post:
<mailto:php-general@lists.php.net>
Delivered-To:
mailing list php-general@lists.php.net
Received:
(qmail 38564 invoked from network); 20 Aug 2008 09:06:34 -
Authentication-Results:
pb1.pair.com [EMAIL PROTECTED]; sender-id=unknown
Authentication-Results:
pb1.pair.com [EMAIL PROTECTED]; spf=permerror; 
sender-id=unknown

Received-SPF:
error (pb1.pair.com: domain iamjochem.com from 194.109.193.121 cause and 
error)

X-PHP-List-Original-Sender:
[EMAIL PROTECTED]
X-Host-Fingerprint:
194.109.193.121 mx1.moulin.nl Linux 2.6
X-Virus-Scanned:
amavisd-new at moulin.nl
Bericht-ID:
<[EMAIL PROTECTED]>
User-agent:
Thunderbird 2.0.0.16 (Macintosh/20080707)
MIME-versie:
1.0
Referenties:
<[EMAIL PROTECTED]> 
<[EMAIL PROTECTED]>

In-Reply-To:
<[EMAIL PROTECTED]>
X-Enigmail-Version:
0.95.6
Content-Type:
text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding:
base64


Ashley Sheridan schreef:
I don't think GD has a built-in function to scale an image the way you 
are asking,


of course you can scale images with GD, but everything works in pixels,
ImageMagick is no different ... there is no such thing as millimeters 
when it
comes to bitmap images, you can specify an output resolution when 
printing but

that has no direct bearing on the image file itself.

Alex will have to figure out the bounding box ratios of the dimensions 
given in
mm and transpose that into the 300x150 pixel image he's going to use as 
a canvas,
the math is not that hard (can't be if I can manage it!) and although it 
won't

be a perfect at all times he did mention it's a representation.

If Alex requires pixel perfect representation of print output in a file 
then he
is going to have to resort to some kind of vector based image 
representation
(e.g. Adobe Illustrator) but scripting that with php is possibly going 
to be very
tricky, either using a COM object or shelling out to something like 
AppleScript
(which I know you can use to do some really crazy Illustrator scripting 
with)


and to do it on a pixel by pixel basis from within a function is going 
to be a very time consuming and memory costly process. Have you 
thought about using ImageMagik to do this? I know that you can exec() 
out to this from within Windows and Linux, and ImageMagik is free to 
use (as far as I'm aware) so it could be just what you need.


Ash
www.ashleysheridan.co.uk




Onderwerp:
[PHP] Image Generation
Van:
"Alex Chamberlain" <[EMAIL PROTECTED]>
Datum:
Wed, 20 Aug 2008 08:29:50 +0100
Aan:
"PHP General list" 

Aan:
"PHP General list" 

Return-path:
<[EMAIL PROTECTED]>
Envelope-to:
[EMAIL PROTECTED]
Delivery-date:
Wed, 20 Aug 2008 08:30:52 +0100
Received:
from [216.92.131.4] (port=26599 helo

Re: [PHP] Image Generation

2008-08-20 Thread Ashley Sheridan
Hence me saying "in the way you are asking" I know GD can scale images
(I've done that myself on more than one occassion), but not images that
are intended for print as opposed to screen viewing, as this appears to
be.

As for quality, I've found that GD offers comparable quality images to
ImageMagik, and in better time more often than not. The main advantage
ImageMagik has is with functionality; quite simply, it can do much more
than GD and GD2.

Ash
www.ashleysheridan.co.uk
--- Begin Message ---

Ashley Sheridan schreef:
I don't think GD has a built-in function to scale an image the way you 
are asking,


of course you can scale images with GD, but everything works in pixels,
ImageMagick is no different ... there is no such thing as millimeters when it
comes to bitmap images, you can specify an output resolution when printing but
that has no direct bearing on the image file itself.

Alex will have to figure out the bounding box ratios of the dimensions given in
mm and transpose that into the 300x150 pixel image he's going to use as a 
canvas,
the math is not that hard (can't be if I can manage it!) and although it won't
be a perfect at all times he did mention it's a representation.

If Alex requires pixel perfect representation of print output in a file then he
is going to have to resort to some kind of vector based image representation
(e.g. Adobe Illustrator) but scripting that with php is possibly going to be 
very
tricky, either using a COM object or shelling out to something like AppleScript
(which I know you can use to do some really crazy Illustrator scripting with)

and to do it on a pixel by pixel basis from within a 
function is going to be a very time consuming and memory costly process. 
Have you thought about using ImageMagik to do this? I know that you can 
exec() out to this from within Windows and Linux, and ImageMagik is free 
to use (as far as I'm aware) so it could be just what you need.


Ash
www.ashleysheridan.co.uk


--------

Onderwerp:
[PHP] Image Generation
Van:
"Alex Chamberlain" <[EMAIL PROTECTED]>
Datum:
Wed, 20 Aug 2008 08:29:50 +0100
Aan:
"PHP General list" 

Aan:
"PHP General list" 

Return-path:
<[EMAIL PROTECTED]>
Envelope-to:
[EMAIL PROTECTED]
Delivery-date:
Wed, 20 Aug 2008 08:30:52 +0100
Received:
from [216.92.131.4] (port=26599 helo=lists.php.net) by 
zencphosting11.zen.co.uk with esmtp (Exim 4.68) (envelope-from 
<[EMAIL PROTECTED]>) id 
1KVi9b-0007aA-Qe for [EMAIL PROTECTED]; Wed, 20 Aug 2008 08:30:51 
+0100

X-Host-Fingerprint:
216.92.131.4 lists.php.net
Received:
from [216.92.131.4] ([216.92.131.4:26502] helo=lists.php.net) by 
pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 
B7/47-51571-A28CBA84 for <[EMAIL PROTECTED]>; Wed, 20 Aug 2008 
03:30:50 -0400

Received:
(qmail 5047 invoked by uid 1010); 20 Aug 2008 07:30:37 -
Mailing-List:
contact [EMAIL PROTECTED]; run by ezmlm
Precedence:
bulk
list-help:
<mailto:[EMAIL PROTECTED]>
list-unsubscribe:
<mailto:[EMAIL PROTECTED]>
list-post:
<mailto:php-general@lists.php.net>
Delivered-To:
mailing list php-general@lists.php.net
Received:
(qmail 5040 invoked from network); 20 Aug 2008 07:30:37 -
Authentication-Results:
pb1.pair.com [EMAIL PROTECTED]; spf=permerror; 
sender-id=unknown

Authentication-Results:
pb1.pair.com [EMAIL PROTECTED]; sender-id=unknown
Received-SPF:
error (pb1.pair.com: domain alexchamberlain.co.uk from 79.170.40.18 
cause and error)

X-PHP-List-Original-Sender:
[EMAIL PROTECTED]
X-Host-Fingerprint:
79.170.40.18 mail18.extendcp.co.uk Linux 2.5 (sometimes 2.4) (4)
Bericht-ID:
<[EMAIL PROTECTED]>
MIME-versie:
1.0
Content-Type:
text/plain; charset="windows-1250"
X-Mailer:
Microsoft Office Outlook 12.0
Thread-Index:
AckCloefPR8PGF4zQNGV6eViXsKrxQ==
Content-Language:
en-gb
Content-Transfer-Encoding:
base64


Hi,

I need to generate an online proof for vinyl lettering. Customers specify
the text, font, colour, maximum frame size (mm) (ie the width and height it
must fit into), and whether or not they want to keep aspect ratio (ie not
distort the lettering).

I want to represent all this on a single image. So it would display a border
with their width and height on, and inside this would be the text in the
appropriate colour and font – if they decide to keep aspect ratio the text
would not be distorted. If they do not, it would be. The image would always
be 300px wide by 150px high (these would need to be constants that I could
change from time to time).

I’ve got a very basic proof working using a GD wrapper, but I don’t think GD
is powerful enough to do it all, nor do I recon my programming skills are up
for it. Has anybody got any advice on how to tackle this, even if it is just
bits of the problem??

Thanks,

Alex Chamberlain



No virus found in this outgoing message. Scan

Re: [PHP] Image Generation

2008-08-20 Thread Jochem Maas

Ashley Sheridan schreef:
I don't think GD has a built-in function to scale an image the way you 
are asking,


of course you can scale images with GD, but everything works in pixels,
ImageMagick is no different ... there is no such thing as millimeters when it
comes to bitmap images, you can specify an output resolution when printing but
that has no direct bearing on the image file itself.

Alex will have to figure out the bounding box ratios of the dimensions given in
mm and transpose that into the 300x150 pixel image he's going to use as a 
canvas,
the math is not that hard (can't be if I can manage it!) and although it won't
be a perfect at all times he did mention it's a representation.

If Alex requires pixel perfect representation of print output in a file then he
is going to have to resort to some kind of vector based image representation
(e.g. Adobe Illustrator) but scripting that with php is possibly going to be 
very
tricky, either using a COM object or shelling out to something like AppleScript
(which I know you can use to do some really crazy Illustrator scripting with)

and to do it on a pixel by pixel basis from within a 
function is going to be a very time consuming and memory costly process. 
Have you thought about using ImageMagik to do this? I know that you can 
exec() out to this from within Windows and Linux, and ImageMagik is free 
to use (as far as I'm aware) so it could be just what you need.


Ash
www.ashleysheridan.co.uk


--------

Onderwerp:
[PHP] Image Generation
Van:
"Alex Chamberlain" <[EMAIL PROTECTED]>
Datum:
Wed, 20 Aug 2008 08:29:50 +0100
Aan:
"PHP General list" 

Aan:
"PHP General list" 

Return-path:
<[EMAIL PROTECTED]>
Envelope-to:
[EMAIL PROTECTED]
Delivery-date:
Wed, 20 Aug 2008 08:30:52 +0100
Received:
from [216.92.131.4] (port=26599 helo=lists.php.net) by 
zencphosting11.zen.co.uk with esmtp (Exim 4.68) (envelope-from 
<[EMAIL PROTECTED]>) id 
1KVi9b-0007aA-Qe for [EMAIL PROTECTED]; Wed, 20 Aug 2008 08:30:51 
+0100

X-Host-Fingerprint:
216.92.131.4 lists.php.net
Received:
from [216.92.131.4] ([216.92.131.4:26502] helo=lists.php.net) by 
pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 
B7/47-51571-A28CBA84 for <[EMAIL PROTECTED]>; Wed, 20 Aug 2008 
03:30:50 -0400

Received:
(qmail 5047 invoked by uid 1010); 20 Aug 2008 07:30:37 -
Mailing-List:
contact [EMAIL PROTECTED]; run by ezmlm
Precedence:
bulk
list-help:
<mailto:[EMAIL PROTECTED]>
list-unsubscribe:
<mailto:[EMAIL PROTECTED]>
list-post:
<mailto:php-general@lists.php.net>
Delivered-To:
mailing list php-general@lists.php.net
Received:
(qmail 5040 invoked from network); 20 Aug 2008 07:30:37 -
Authentication-Results:
pb1.pair.com [EMAIL PROTECTED]; spf=permerror; 
sender-id=unknown

Authentication-Results:
pb1.pair.com [EMAIL PROTECTED]; sender-id=unknown
Received-SPF:
error (pb1.pair.com: domain alexchamberlain.co.uk from 79.170.40.18 
cause and error)

X-PHP-List-Original-Sender:
[EMAIL PROTECTED]
X-Host-Fingerprint:
79.170.40.18 mail18.extendcp.co.uk Linux 2.5 (sometimes 2.4) (4)
Bericht-ID:
<[EMAIL PROTECTED]>
MIME-versie:
1.0
Content-Type:
text/plain; charset="windows-1250"
X-Mailer:
Microsoft Office Outlook 12.0
Thread-Index:
AckCloefPR8PGF4zQNGV6eViXsKrxQ==
Content-Language:
en-gb
Content-Transfer-Encoding:
base64


Hi,

I need to generate an online proof for vinyl lettering. Customers specify
the text, font, colour, maximum frame size (mm) (ie the width and height it
must fit into), and whether or not they want to keep aspect ratio (ie not
distort the lettering).

I want to represent all this on a single image. So it would display a border
with their width and height on, and inside this would be the text in the
appropriate colour and font – if they decide to keep aspect ratio the text
would not be distorted. If they do not, it would be. The image would always
be 300px wide by 150px high (these would need to be constants that I could
change from time to time).

I’ve got a very basic proof working using a GD wrapper, but I don’t think GD
is powerful enough to do it all, nor do I recon my programming skills are up
for it. Has anybody got any advice on how to tackle this, even if it is just
bits of the problem??

Thanks,

Alex Chamberlain



No virus found in this outgoing message. Scanned by AVG Free 8.0
Checked by AVG - http://www.avg.com 
Version: 8.0.138 / Virus Database: 270.6.6/1621 - Release Date: 19/08/2008

18:53






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



Re: [PHP] Image Generation

2008-08-20 Thread Jochem Maas

Alex Chamberlain schreef:

Hi,

I need to generate an online proof for vinyl lettering. Customers specify
the text, font, colour, maximum frame size (mm) (ie the width and height it
must fit into), and whether or not they want to keep aspect ratio (ie not
distort the lettering).

I want to represent all this on a single image. So it would display a border
with their width and height on, and inside this would be the text in the
appropriate colour and font – if they decide to keep aspect ratio the text
would not be distorted. If they do not, it would be. The image would always
be 300px wide by 150px high (these would need to be constants that I could
change from time to time).

I’ve got a very basic proof working using a GD wrapper, but I don’t think GD
is powerful enough to do it all, nor do I recon my programming skills are up
for it. Has anybody got any advice on how to tackle this, even if it is just
bits of the problem??


GD can do all this, although I hear said that ImageMagick does more and has 
somewhat
better output.

you'll only be able to offer fonts that you have installed on the server, also
image generation works in pixels so you'll have to come up with a way to 
'convert'
millimeters to a pixel value for display purposes.

I offer you a class that you might be able to use, at least for inspiration ...
the pertinent functions used are ImageColorAllocate(), ImageTTFBBox() and 
ImageTTFText()

setOffset( 28, 40 );
$renderer->setBgImage( '/images/headerbase-lightblue.jpg' );
// $renderer->setBgColor( ??? );
$renderer->setLifetime( 1000 );
// $renderer->setMaxLines( 1 )
$renderer->render(
array( 'THESE', 'ARE', 'strings' ),
array( 10, 14, 18 ),
array( '/fonts/arial.ttf', '/fonts/verdana.ttf', '/fonts/symbol.ttf' ),
);

 *
 */

class RenderTTFText
{
var $xsize, $ysize;
var $xoffset,   $yoffset,   $margin;
var $bgimage,   $bgimagetype;
var $bgcolor,   $fgcolor;

var $lifetime;
var $maxLines;

var $transparent;

// nasty little hack :-)
var $stringSpacingOffsetTweak;

var $im; // reference to the image resource.

function RenderTTFText($xsize = null, $ysize = null)
{
$this->xsize= (is_integer($xsize) && $xsize) ? 100: $xsize;
$this->ysize= (is_integer($ysize) && $ysize) ? 100: $ysize;
$this->xoffset  = 0;
$this->yoffset  = 0;
$this->margin   = 0;
$this->bgcolor  = array(0,0,0);
$this->fgcolor  = array(255,255,255);
$this->lifetime = 0;
$this->maxLines = 1;
$this->transparent  = false;

$this->stringSpacingOffsetTweak = 0;
}

function setOffset($x,$y,$m = 0)
{
$this->xoffset = intval($x);
$this->yoffset = intval($y);
$this->margin  = intval($y);
}

function setBgImage($img_file)
{
$this->bgimage = $img_file;
list($this->xsize, $this->ysize, $this->bgimagetype) = 
GetImageSize($this->bgimage);
}

function setBgColor($color)
{
$this->bgcolor = $this->convColor($color);
}

function setLifetime($t)
{
$this->lifetime = intval($t);
}

function setMaxLines($l)
{
if (($l = intval($l)) > 0) {
$this->maxLines = $l;
}
}

function setTransparent($b = true)
{
$this->transparent = (boolean)$b;
}

function setStringSpacingOffsetTweak($v)
{
if (is_numeric($v)) {
$this->stringSpacingOffsetTweak = $v;
}
}

/*
 * $text, a string or array of strings. - strings to display in order.
 * $size, a float or an array of floats - which size to display the related 
text at.
 * $font, a fontfilename or an array of fontfilenames - which font to use 
for the related text string
 * $br,   a boolean, or an array of bools - whether to follow the related 
$text string with a line break
 */
function render($text, $size, $font, $color, $br = false)
{
/* our text items to render (each item can have a seperate size, font 
and linebreak(true/false) */
foreach (array('text','size','font','color','br') as $arg) {
if (!is_array(${$arg})) $$arg = array(${$arg});
if ($arg == 'text') {
$tcount = count($text);
$text   = array_map('trim', $text);
} else {
while (($c = count(${$arg})) < $tcount) {
if (!isset(${$arg}[$c - 1])) {
return false;
}
${$arg}[$c] = ($arg == 'br')
  ? false
  : ${$arg}[$c - 1];
}
}

${$arg} = array_values(${$arg});
}

/* create the background/base image */
if (! empty($this->bgimage)) {
switch ($this->bgimagetype) {
case 3:
$this->im = ImageCreateF

Re: [PHP] Image Generation

2008-08-20 Thread Ashley Sheridan
I don't think GD has a built-in function to scale an image the way you
are asking, and to do it on a pixel by pixel basis from within a
function is going to be a very time consuming and memory costly process.
Have you thought about using ImageMagik to do this? I know that you can
exec() out to this from within Windows and Linux, and ImageMagik is free
to use (as far as I'm aware) so it could be just what you need.

Ash
www.ashleysheridan.co.uk
--- Begin Message ---
Hi,

I need to generate an online proof for vinyl lettering. Customers specify
the text, font, colour, maximum frame size (mm) (ie the width and height it
must fit into), and whether or not they want to keep aspect ratio (ie not
distort the lettering).

I want to represent all this on a single image. So it would display a border
with their width and height on, and inside this would be the text in the
appropriate colour and font – if they decide to keep aspect ratio the text
would not be distorted. If they do not, it would be. The image would always
be 300px wide by 150px high (these would need to be constants that I could
change from time to time).

I’ve got a very basic proof working using a GD wrapper, but I don’t think GD
is powerful enough to do it all, nor do I recon my programming skills are up
for it. Has anybody got any advice on how to tackle this, even if it is just
bits of the problem??

Thanks,

Alex Chamberlain



No virus found in this outgoing message. Scanned by AVG Free 8.0
Checked by AVG - http://www.avg.com 
Version: 8.0.138 / Virus Database: 270.6.6/1621 - Release Date: 19/08/2008
18:53


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

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

[PHP] Image Generation

2008-08-20 Thread Alex Chamberlain
Hi,

I need to generate an online proof for vinyl lettering. Customers specify
the text, font, colour, maximum frame size (mm) (ie the width and height it
must fit into), and whether or not they want to keep aspect ratio (ie not
distort the lettering).

I want to represent all this on a single image. So it would display a border
with their width and height on, and inside this would be the text in the
appropriate colour and font – if they decide to keep aspect ratio the text
would not be distorted. If they do not, it would be. The image would always
be 300px wide by 150px high (these would need to be constants that I could
change from time to time).

I’ve got a very basic proof working using a GD wrapper, but I don’t think GD
is powerful enough to do it all, nor do I recon my programming skills are up
for it. Has anybody got any advice on how to tackle this, even if it is just
bits of the problem??

Thanks,

Alex Chamberlain



No virus found in this outgoing message. Scanned by AVG Free 8.0
Checked by AVG - http://www.avg.com 
Version: 8.0.138 / Virus Database: 270.6.6/1621 - Release Date: 19/08/2008
18:53


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



Re: [PHP] Image modifications

2008-05-25 Thread Chris
Ronald Wiplinger wrote:
> I would like to find some samples to start with.
> 
> We want to upload a picture and the user may apply some "filters" or
> "instructions" to create a new picture, based on the uploaded picture and
> the available "filters" and "instructions".
> 
> The idea of it is not really mature, since we have no idea where to start
> and what is possible to do.

Depends. What do you want to do (what is a filter, what are instructions)?

imagemagick and to a (much?) lesser extent, gd - let you do image
manipulations but it depends what you need to be able to do.

-- 
Postgresql & php tutorials
http://www.designmagick.com/

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



[PHP] Image modifications

2008-05-25 Thread Ronald Wiplinger
I would like to find some samples to start with.

We want to upload a picture and the user may apply some "filters" or
"instructions" to create a new picture, based on the uploaded picture and
the available "filters" and "instructions".

The idea of it is not really mature, since we have no idea where to start
and what is possible to do.

bye

R.


Re: [PHP] image* Functions' Memory Usage

2008-01-04 Thread Ólafur Waage
I recently made two commercial sites that used both GD and Imagick and
i can share some wisdom i got from those projects.

(both projects were "card" generators where users made their custom
cards and but one had a fixed picture and users could add text and the
other one allowed users to add their own picture with text)

# Some functions of the GD library are VERY memory intensive.
For example the image resizing. The resizing process is calling three
functions to work and two of them are holding very large amounts of
data within them. (the original image and the new image area you are
going to put the resized image into, and then the 3rd functions
resizes the image)

# Basic GD library functions can be quite fast (and most if not all
Imagick functions are fast if the image isn't too big)

# Speed of both options are always affected by the size of the image
being used. (Size in bytes, a 10x15 print quality card generated with
a user selected image + text can take up to 30 seconds to generate)
And yes thats an annoying generator to debug.

# If you are going beyond simple things like adding text onto an image
i recommend going with Imagick.

# Imagick is a great system to use if you learn all the command lines
and combinations, far superior to GD in many ways.

# Complex Imagick functions (that works with all possible outcomes)
can be VERY slow.

# If you have the choice of running Imagick from the command line
(installed onto the linux system) or running the Imagick PHPlib, go
with the PHP library one (even though it looks like more overhead in
code) since error reporting with the command line is close to none.

# If you have the choice of the images being generated later (ie. by
an admin of the system), go with that path always. (one of my systems
does that and the other doesn't) and the problems with the end users
on the image generating step are very hard to debug, since they
usually describe the problems very badly.

Hope this helps some.

- Ólafur Waage
[EMAIL PROTECTED]

2008/1/4, Casey <[EMAIL PROTECTED]>:
> Greetings, list.
>
> I have a web application that generates PNG images that are thousands
> of pixels high by thousands of pixels wide (using imagepng, etc.).
>
> The problem is this takes way too much memory, and the rest of the
> site becomes too slow.
>
> I'm working on something to cache the images, but some suggestions in
> the meantime would be great.
>
> Maybe ImageMagick is faster? Flash?Any suggestions? Thank you very much.
>
> - Casey
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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



Re: [PHP] image* Functions' Memory Usage

2008-01-04 Thread Dan
"Casey" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]

On Jan 4, 2008, at 9:54 AM, "Daniel Brown" <[EMAIL PROTECTED]> wrote:


On Jan 4, 2008 12:46 PM, Casey <[EMAIL PROTECTED]> wrote:

Greetings, list.

I have a web application that generates PNG images that are thousands
of pixels high by thousands of pixels wide (using imagepng, etc.).

The problem is this takes way too much memory, and the rest of the
site becomes too slow.

I'm working on something to cache the images, but some suggestions in
the meantime would be great.

Maybe ImageMagick is faster? Flash?Any suggestions? Thank you very 
much.


   It depends on what you are trying to do with the images.  Are you
randomly-generating data to create patterns, or are you (*gasp*)
converting small images into [very pixelized] larger ones?

--
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.


I'm laying many different other (smaller) images over each other at 
various positions. (I know HTML/CSS and SVG could do this with less 
trouble, but that would give away my secrets by just viewing the  source.)


-Casey


Have you considered obscuficated javascript?  It's not very hard to have JS 
add a few images and rotate/move them where ever you want.  Plus there's not 
too many people that could make much sense from clear plain JS anyway. 
Flash is also a good bet.


- Dan 


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



Re: [PHP] image* Functions' Memory Usage

2008-01-04 Thread Daniel Brown
On Jan 4, 2008 12:59 PM, Casey <[EMAIL PROTECTED]> wrote:
[snip]
> I'm laying many different other (smaller) images over each other at
> various positions. (I know HTML/CSS and SVG could do this with less
> trouble, but that would give away my secrets by just viewing the
> source.)

Okay, so kind of like a mural, but for a different purpose.

For size, Flash would be your best bet, because everything is
converted to a Vector but getting PHP to output to that is beyond
my scope of knowledge, to be honest.

I would probably do things with GD or ImageMagick, as you've
already hinted.  NetPBM might even be a viable alternate route.

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

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



Re: [PHP] image* Functions' Memory Usage

2008-01-04 Thread Casey

On Jan 4, 2008, at 9:54 AM, "Daniel Brown" <[EMAIL PROTECTED]> wrote:


On Jan 4, 2008 12:46 PM, Casey <[EMAIL PROTECTED]> wrote:

Greetings, list.

I have a web application that generates PNG images that are thousands
of pixels high by thousands of pixels wide (using imagepng, etc.).

The problem is this takes way too much memory, and the rest of the
site becomes too slow.

I'm working on something to cache the images, but some suggestions in
the meantime would be great.

Maybe ImageMagick is faster? Flash?Any suggestions? Thank you very  
much.


   It depends on what you are trying to do with the images.  Are you
randomly-generating data to create patterns, or are you (*gasp*)
converting small images into [very pixelized] larger ones?

--
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.


I'm laying many different other (smaller) images over each other at  
various positions. (I know HTML/CSS and SVG could do this with less  
trouble, but that would give away my secrets by just viewing the  
source.)


-Casey

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



Re: [PHP] image* Functions' Memory Usage

2008-01-04 Thread Daniel Brown
On Jan 4, 2008 12:46 PM, Casey <[EMAIL PROTECTED]> wrote:
> Greetings, list.
>
> I have a web application that generates PNG images that are thousands
> of pixels high by thousands of pixels wide (using imagepng, etc.).
>
> The problem is this takes way too much memory, and the rest of the
> site becomes too slow.
>
> I'm working on something to cache the images, but some suggestions in
> the meantime would be great.
>
> Maybe ImageMagick is faster? Flash?Any suggestions? Thank you very much.

It depends on what you are trying to do with the images.  Are you
randomly-generating data to create patterns, or are you (*gasp*)
converting small images into [very pixelized] larger ones?

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

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



[PHP] image* Functions' Memory Usage

2008-01-04 Thread Casey

Greetings, list.

I have a web application that generates PNG images that are thousands  
of pixels high by thousands of pixels wide (using imagepng, etc.).


The problem is this takes way too much memory, and the rest of the  
site becomes too slow.


I'm working on something to cache the images, but some suggestions in  
the meantime would be great.


Maybe ImageMagick is faster? Flash?Any suggestions? Thank you very much.

- Casey

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



[PHP] Image functions: date?

2007-12-01 Thread Dotan Cohen
I remember once coming across a bit of php code that displayed the
"created" date of a jpeg image. I cannot find it, and I cannot find
anything related to that in tfm. Can someone give me a push in the
general direction? Thanks in advance.

Dotan Cohen

http://what-is-what.com
http://gibberish.co.il
א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?


Re: [PHP] image galleries

2007-11-22 Thread Martin Marques
Lisa A escribió:
> Does anyone know of an image gallery I can use on multiple pages of a 
> website.  I'd like to be able to click on the thumbnails and see a larger 
> image.
> Hopefully something simple and easy to install.

gallery2

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



  1   2   3   4   5   6   7   8   9   >