473,320 Members | 1,846 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.

i want to read image form c and compress it

I want to read image form c and compress it on turbo c.

Expand|Select|Wrap|Line Numbers
  1. #include<stdio.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5.   FILE*fptr;
  6.     fptr=fopen("D:\\abc.jpg","r");
  7.     printf("%c",getc(fptr));
  8. }
  9. getch();
  10. }
Apr 27 '11 #1
1 2034
Expand|Select|Wrap|Line Numbers
  1. #include<stdio.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5. int i;
  6. char a;
  7.  
  8. FILE*fptr;
  9.  clrscr();
  10. fptr=fopen("C:\\h.jpg","r");
  11.  
  12. while(1)
  13. {
  14.  if(fgetc(fptr)!=EOF)
  15.  {
  16.  
  17.    printf("%f",fgetc(fptr));
  18.  }
  19. else
  20.     {
  21.     break;
  22.     }
  23. }
  24. getch();
  25. }


This project reads an image, please tell me if this program loads the get image correctly or not. Another question is that I get image header or bytes.
Apr 27 '11 #2

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

Similar topics

1
by: Thomas | last post by:
Hi all, Is there a faster way to read image dimensions other than something like: ImageOrig = System.Drawing.Image.FromFile(Filepath); ImageOrigHeight = ImageOrig.Height; ImageOrigWidth =...
2
by: joe | last post by:
how to read image from sql server to show in a image
4
by: abumarwah | last post by:
im new in this area using c++, and i want to write program read image and display it in form of array or matrix
70
by: quickcur | last post by:
hi can anyone explain me to read image to memory from a url it is very easy in java but it is hard to find an complete solution in c/c++. Thanks,
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
1
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

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.