You don't need to research or guess the number of bytes. The operating system is quite probably telling you how many bytes you got from the camera, but you're not using it, or using it incorrectly. The parts of the code you've shown us, so far, have nothing to with reading the data, just writing it. For that matter, it's run in a loop which you've never shown us, which might have things wrong in it too.
None of the information on your corrupted output file will help tell us what's wrong in code we've never seen.
In short: We can't fix your code because you didn't show it to us. Please post your code. All of it.
code is to long to put, but I think problem is with bitstream and way it constructs jpeg.
using fread to fwrite from on jpeg to another jpeg works, but
I am using read from serial device and using fwrite to jpeg file,
which seems to be causing the stream problem.
basics of main code to grab packets as they come in from serial:
parse code for each packet is basically
I actually found a website that has the exact same corrupted looking jpeg pictures as the ones that are created from code.
That's a bit more helpful. You've opened the device with O_NDELAY, this means read might sometimes return -1, telling you to try again later. When this happens your code will still write something, even though it shouldn't.
Quote:
Seems to be a stream issue, how would I create the fread to fwrite stream using read to fwrite, which seems to not put the stream correctly.
You have to use read() for handling a device file.
In summary: Always check the return value of everything.
Hi guys im currently trying to write a script which includes rename files and this is the part where i fail
i have a list of files eg
and i want to rename them so
any help really would be appreciated
Cheers dunryc (7 Replies)
Hello
I try to send DHCP RENEW packets to the network and receive the responses. I broadcast the packet and I can see that it's successfully sent using Wireshark. But I have difficulties receiving the responses.I use packet sockets to catch the packets. I can see that there are responses to my... (0 Replies)
Hello!
I'm desperately trying to write a makefile that converts and scales jpeg files to png files in subdirectories
I want to use netpbm, so I just need the commands:
anytopnm
pnmscale
pnmtopng
For various reasons i want to use a makefile. This is the first time i use the make tool... (1 Reply)
Hi,
how to insert JPEG on each side of the cube using OpenGL in C language..
i have a program for cube..
guide me ,,,
any answer will valuable.. (3 Replies)
Hi to all
Like in the subject, i got the problem with camera ID 0c45:613b Microdia Win2 PC Camera under Ubuntu. When i plug in camera to USB, Ubuntu put in sn9c102 module, but on this site Linux Kernel Driver Database: CONFIG_USB_GSPCA_SONIXJ: SONIX JPEG USB Camera Driver is information that... (0 Replies)
I trying to send and receive OSPF packets. I am using RAW Sockets(socket(AF_INET, SOCK_RAW, IPPROTO_OSPF)) to do this.
I am successfully able to send an OSPF Hello packet however I am not able to receive a OSPF packet if I have not sent an OSPF packet earlier on the RAW SOCKET.
Scenario:
... (3 Replies)
I was wondering what program can i use instead of mozilla to view a picture on a sun solaris system running SunOS 5.8.
To view a pic i'm currently doing it this way:
xterm -sb -fn screen-bold -g 60x30+0-0 -title '%s window - pls quit window upon completion ' -e mozilla file:///usr/sailing.JPG
... (4 Replies)
I'm running a Sunblade 1500 with 2 XVR-100 video cards. I have Xinerama runing as well. Desktop is CDE. Can someone help me in converting Jpeg pictures so that I can use them as backdrops? Is there a way to make the picture come on both monitors instead of streaching it across both?
Thanks. (1 Reply)