Jump to content

Dealing with raw jpg data


joeb

Recommended Posts

Hi,

 

I have a flash app that I am developing for doing some photo manipulation.  One of the apps features is to save the updated image back to the server.  I am using a php script to do this.  The script currently gets given the raw jpeg data as a string, and the location for the file to be saved.  I am wondering if i can create an image object of some form from the raw data.

<?php

if ( isset ( $GLOBALS["HTTP_RAW_POST_DATA"] )) {

// get bytearray
$img = $GLOBALS["HTTP_RAW_POST_DATA"];

// add headers for download dialog-box
$fileName=$_GET['name'];
imagejpeg($img, $fileName, 90);

}  else echo 'An error occured.';

?>

 

Right now, the imagejpeg line does not work because it wants an image object and i am giving it a string of raw data.  Is there a simple way to turn the string of raw data into an actual object?

 

Thanks.

 

ps, $img contains the raw data, and $fileName contains the relative server path for the save.

Link to comment
https://forums.phpfreaks.com/topic/194727-dealing-with-raw-jpg-data/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.