Ive made a php image thumbnailer and i want to output the thumb in a webpage without having to save it to a file on my server, im trying to do it with imagejpeg($file); but since it is within a html document the headers arnt right and it just outputs a bunch of random characters?
thumbnail help
Started by BlazeForc3, Aug 13 2006 08:55 PM
6 replies to this topic
#1
Posted 13 August 2006 - 08:55 PM
#2
Posted 13 August 2006 - 10:42 PM
Well, you have two options with this.
Either you make a function (which I wouldn't recommend personally), or you can make a file which can easily be used with anything.
It's not just 'random characters' by the way, lol, those are the bits that describe the image to a program.
(I know you know that, lol.)
Anyways, ya, you can't have it like that anyways, you would actually have to have it a seperate file now that I think of it...
Then you would call an image simply like this.
If you need help, feel free to contact me over MSN or something. I just finished editing a thumbnailer this afternoon and adding my own little features lol.
Either you make a function (which I wouldn't recommend personally), or you can make a file which can easily be used with anything.
It's not just 'random characters' by the way, lol, those are the bits that describe the image to a program.
Anyways, ya, you can't have it like that anyways, you would actually have to have it a seperate file now that I think of it...
Then you would call an image simply like this.
<img src="/thumbnail.php?src=images/file.jpg" />
If you need help, feel free to contact me over MSN or something. I just finished editing a thumbnailer this afternoon and adding my own little features lol.
#3
Posted 13 August 2006 - 10:46 PM
Be sure to send the headers as an image type or you will see weird characters. You need to send them before making the image output.
#4
Posted 14 August 2006 - 02:31 AM
Demonslay, on Aug 14 2006, 03:42 AM, said:
Well, you have two options with this.
Either you make a function (which I wouldn't recommend personally), or you can make a file which can easily be used with anything.
It's not just 'random characters' by the way, lol, those are the bits that describe the image to a program.
(I know you know that, lol.)
Anyways, ya, you can't have it like that anyways, you would actually have to have it a seperate file now that I think of it...
Then you would call an image simply like this.
If you need help, feel free to contact me over MSN or something. I just finished editing a thumbnailer this afternoon and adding my own little features lol.
Either you make a function (which I wouldn't recommend personally), or you can make a file which can easily be used with anything.
It's not just 'random characters' by the way, lol, those are the bits that describe the image to a program.
Anyways, ya, you can't have it like that anyways, you would actually have to have it a seperate file now that I think of it...
Then you would call an image simply like this.
<img src="/thumbnail.php?src=images/file.jpg" />
If you need help, feel free to contact me over MSN or something. I just finished editing a thumbnailer this afternoon and adding my own little features lol.
if thats the case then how can i execute a function when the user navigates away from the page or closes the browser window?
#5
Posted 14 August 2006 - 04:00 AM
IF you want to trigger a function when the user leaves the page (that's what I understand you want) you should do it with javascript on that page somehow, but you can't trigger PHP functions with that, or you do it on a new page.
What kind of function, for starters?
What kind of function, for starters?
#6
Posted 15 August 2006 - 01:51 AM
BlazeForc3, on Aug 14 2006, 01:30 AM, said:
if thats the case then how can i execute a function when the user navigates away from the page or closes the browser window?
#7
Posted 18 August 2006 - 08:35 AM
rc69, on Aug 15 2006, 06:50 AM, said:
BlazeForc3, on Aug 14 2006, 01:30 AM, said:
if thats the case then how can i execute a function when the user navigates away from the page or closes the browser window?
your a very helpfull person when it comes to php rc69 thanks
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
