Sponsored Content
Top Forums Programming Receiving JPEG packet from camera Post 302480966 by photon on Thursday 16th of December 2010 09:16:29 AM
Old 12-16-2010
Receiving JPEG packet from camera

I am trying to receive a packet of data as bytes in C, but the picture is getting messed up.

I am using fwrite to append bytes to jpg file, but the append or write does not
seem to be appending jpg correctly.

Packet 1 data comes in append to file
Packet 2 data comes in append to file
...
N packets

Code:
void BWrite(unsigned char *b){
    FILE *fp;
    fp = fopen(filename, "ab");
    fwrite(b,1,1,fp);
    fclose(fp);
}

The computer runs centos on flash hard drive.

My brain is fried and out of ideas on how to get this JPEG looking right instead of as bad looking jigsaw puzzle Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Convert Jpeg to useable Unix Pics

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)
Discussion started by: HSTheDuck
1 Replies

2. UNIX for Advanced & Expert Users

Jpeg viewer on SunOS 5.8

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)
Discussion started by: wisher115
4 Replies

3. UNIX for Dummies Questions & Answers

how do I view a jpeg?

I use gv or ggv to view a .pdf, or .ps file. What will allow me to see a jpeg file? If it matters, I'm using xterm on a PowerBook G4. (0 Replies)
Discussion started by: dsstamps
0 Replies

4. IP Networking

Problem Receiving the first OSPF packet

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)
Discussion started by: cosmic_egg
3 Replies

5. UNIX Desktop Questions & Answers

problem with camera ID 0c45:613b Microdia Win2 PC Camera Ubuntu

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)
Discussion started by: m0z4rt
0 Replies

6. Programming

How to insert JPEG on each side of the cube using openGL in C

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)
Discussion started by: Ravikishore
3 Replies

7. Shell Programming and Scripting

makefile to convert .jpeg to .png thumnails

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)
Discussion started by: henningbaer
1 Replies

8. Programming

Receiving broadcast packets using packet socket

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)
Discussion started by: xyzt
0 Replies

9. Shell Programming and Scripting

renaming jpeg files

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)
Discussion started by: dunryc
7 Replies

10. AIX

Packet loss coming with big packet size ping

(5 Replies)
Discussion started by: Vishal_dba
5 Replies
PUZZLE-DIFF(1)															    PUZZLE-DIFF(1)

NAME
puzzle-diff - Compare pictures with libpuzzle SYNOPSIS
[-b <contrast barrier for cropping>] [-c] [-C <max cropping ratio>] [-e] [-E <similarity threshold>] [-h] [-H <max height>] [-l <lambdas>] [-n <noise cutoff>] [-p <p ratio>] [-t] [-W <max width>] <file 1> <file 2> DESCRIPTION
puzzle-diff compares two pictures and outputs the normalized distance. Try puzzle-diff -h for more info. EXAMPLES
Output distance between two images: $ puzzle-diff pic-a-0.jpg pics-a-1.jpg 0.102286 Compare two images, exit with 10 if they look the same, exit with 20 if they don't (may be useful for scripts): $ puzzle-diff -e pic-a-0.jpg pics-a-1.jpg $ echo $? 10 Compute distance, without cropping and with computing the average intensity of the whole blocks: $ puzzle-diff -p 1.0 -c pic-a-0.jpg pic-a-1.jpg 0.0523151 AUTHORS
Frank DENIS libpuzzle at pureftpd dot org SEE ALSO
libpuzzle(3), puzzle_set(3) 2012-05-09 PUZZLE-DIFF(1)
All times are GMT -4. The time now is 04:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy