Swf generated pixel data in php.. To jpg?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
duder673
Forum Newbie
Posts: 2
Joined: Wed Jan 21, 2009 9:43 pm

Swf generated pixel data in php.. To jpg?

Post by duder673 »

Hello, I am very new to php and I followed this tutorial for Flash to generate an image using a swf that is on my server.
http://www.sephiroth.it/tutorials/flash ... nt_screen/

The problem is, the pixels do not save to a .jpg or .png, they are simply posted inside of a 'pixels.php' file and cannot be downloaded as an image file by the users.

What I am hoping is that the pixels.php could generate an image file instead of posting the pixels, and showing the image to the user that created it, while it is stored on my server.

Any help would be greatly appreciated,
Duder
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Swf generated pixel data in php.. To jpg?

Post by requinix »

If you can see the image then you can save it. For Firefox you can right-click an image and hit Save Image As.
The only thing you mentioned that's not present in the script is how to save the image to your server.

Code: Select all

imagejpeg($img, "", 90);
That "" can be a filename, like "image.jpg". If you give a filename then the image will not be displayed and instead be saved on the machine.

Are you talking about giving the user an open/save dialog?
duder673
Forum Newbie
Posts: 2
Joined: Wed Jan 21, 2009 9:43 pm

Re: Swf generated pixel data in php.. To jpg?

Post by duder673 »

tasairis wrote:If you can see the image then you can save it. For Firefox you can right-click an image and hit Save Image As.
The only thing you mentioned that's not present in the script is how to save the image to your server.

Code: Select all

imagejpeg($img, "", 90);
That "" can be a filename, like "image.jpg". If you give a filename then the image will not be displayed and instead be saved on the machine.

Are you talking about giving the user an open/save dialog?
When I right-click/save as, it asks if I want to save a php file.
The idea is to make it easy on the users, not me for a quick fix to a permanent problem.

I would like them to have the option of saving it where they want.
If not that, then displaying the URL to the image that they have just created .

The idea is to use data that they inputted(text), then take a snap from the processed data(similar to a "scores page of a game), and host it on my server. The data will be updated several times, and the .jpg recreated on command and the old image is to be overwritten (the new image should use the same filename) so that they can link to that image and it will seemingly auto-update where ever they post it on the Internet because it will have the same URL

Also, would there be a way to name the file after some of the data in the Flash file?
Post Reply