473,320 Members | 1,976 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

corrupt images

Hi, Ive been pulling my hair on this one -- who hasnt. Im encoding a jpg using the JPGEncoder and the same code that is out there on the internet.

AS:
Expand|Select|Wrap|Line Numbers
  1. var jpgSource:BitmapData = new BitmapData (sw, sh);
  2.             jpgSource.draw(root);
  3.             var namae:String = TITLE.replace(/[\s]/g, "-");
  4.             var jpgEncoder:JPGEncoder = new JPGEncoder(90);
  5.             var jpgStream:ByteArray = jpgEncoder.encode(jpgSource);
  6.             var header:URLRequestHeader = new URLRequestHeader("Content-type", "application/octet-stream");
  7.             var jpgURLRequest:URLRequest = new URLRequest(URL+"download.php?name="+namae+".jpg");
  8.             jpgURLRequest.requestHeaders.push(header);
  9.             jpgURLRequest.method = URLRequestMethod.POST;
  10.             jpgURLRequest.data = jpgStream;
  11.             navigateToURL(jpgURLRequest, "_top");
  12.  
PHP:
Expand|Select|Wrap|Line Numbers
  1. if (isset( $GLOBALS["HTTP_RAW_POST_DATA"])) {
  2.     $jpg = $GLOBALS["HTTP_RAW_POST_DATA"];
  3.     header('Content-Type: image/jpeg');
  4.     header("Content-Disposition: attachment; filename=".$_GET['name']);
  5.     echo $jpg;
  6. } else {
  7.     echo "An error occured.";
  8. }
  9.  
for some reason, I seem to be the only one in the world who this happens to. About half the time, the image appears as half rendered. Youll see half the stage fine but the other half looks likes its still being drawn out. Ive seen it still green, magenta, gray, all the colors of the rainbow. When I try to load the image in photoshop, it says that the image is corrupted. Im stuck using CS3 for right now, so I still have to bounce downloads off the server. Can anyone offer any insight? I cant tell if its the actual byteArray or if its on the server side. I have no idea where to start to debug this. Please someone help me!
Thanks in advance!!
Dec 9 '09 #1
0 1378

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: deko | last post by:
I need to allow users to download files from a directory that is not publicly accessible. To do this, I use a download script: header("Content-Type: application/octet-stream");...
5
by: Vinay | last post by:
Hi I have a corrupt word file. I am able to open it with the code given below tr Dim pInfo As System.Diagnostics.ProcessStartInfo = New System.Diagnostics.ProcessStartInfo( pInfo.UseShellExecute...
0
by: Filips Benoit | last post by:
A particular form - always the same - sometimes becomes corrupt after saving. Error msg = The expression On Open you entered as the event property settings produced the following error: A...
9
by: Bungle | last post by:
Hi There, Does anybody know where i might be able to locate a tool/application that can determine whether a Database is corrupt?? Also, can a bad network connection cause a corruption to a...
4
by: dixie | last post by:
I have come across some code to walk through the records of a corrupt table and copy it record by record to a new table. It comes from the MVPS.Org site and is as follows. -----------------------...
1
by: apoorv | last post by:
Hi guys, I am writing a imaging aplication on VC++.I have to display images and apply effects onto it.Images could be of any type like jpg,gif,bmp,psd... I am using createDibSection API.it...
0
by: Fredo | last post by:
I have an app that I'm writing to manage jpgs. Sometimes the photos are corrupt. If I use something like ACDSee, it will show the image, but it will have a note in the status bar that the image is...
7
by: eventuranza | last post by:
For my application, there users can upload and download files to the a webserver. Straightforward enough. However, when they upload a PDF file then try to download it, the file seems to be...
3
by: rdemyan via AccessMonster.com | last post by:
One of my users had a corrupt front end that wouldn't open. My app is launched using a launching application (logon app). The logon app has a button for downloading a "fresh" copy of the front...
8
by: iheartvba | last post by:
Hi this is a query made using access query builder: SELECT tblBank.BankID, Now() AS TimeRecd, Val(Right(nz(,0),3)) AS ConsID, "AutoCASH" AS RecUser, tblBank.Dt, Forms!frmRecCASHRunningBal!tbGroup...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.