|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Store imagejpeg($var) as string....
Is there anyway I can store an image, created by imagejpeg as a variable as opposed to outputting to browser??
Example: PHP Code:
Any ideas?? Cheers, Ben |
|
#2
|
|||
|
|||
|
Why do you want to? I'm not sure this is possible but we might be able to come up with an alternative for you.
-KM- |
|
#3
|
|||
|
|||
|
Quote:
I have a workaround, already... But it doesn't 'seem' like the best way... <FONT color=#0000bb> PHP Code:
Basically I'm generating images and storing them in a MySQL database. (if your interested to why.....) I'm generating semi-random* data to populate a database for testing. Each entry requires an image, so I'm generating an image with a record name in the middle *I say semi, because input is sensible(ish) - ie. it makes some sense.... its just not correct. Ben |
|
#4
|
||||
|
||||
|
You can always pass a second parameter to imagejpeg() that specifies a filename to write to and then store a reference to the filename or read the contents of the file after writing it and stick them in the db. The way you're doing it makes pretty good sense to me, though. Pretty smart, actually.
__________________
Please don't PM me asking for solutions outside the scope of a thread. Keeping all responses in a thread stands to help others who come along later, which is after all what this forum's all about. |
|
#5
|
|||
|
|||
|
Quote:
I unfortunately cannot take credit for this 'smart' way! I found the solution on the net. Storing it is fine, but then you've got read/write issues, seems like a waste of resources. I'll drop GD a message and see what they say. Ben |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > Store imagejpeg($var) as string.... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|