473,387 Members | 1,844 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,387 software developers and data experts.

Images (jpeg) in C programming

Hello,

Is it possible to perform basic image manipulation through C? I'd like
to upload images through a web interface and resize them so they are
limited to a max height/width restriction.

My hosting company has gcc v2.95.4 installed, also runs Apache on
Debian.

Thanks
Jock
Nov 13 '05 #1
6 14464
jock <jo*******@hotmail.com> scribbled the following:
Hello, Is it possible to perform basic image manipulation through C? I'd like
to upload images through a web interface and resize them so they are
limited to a max height/width restriction. My hosting company has gcc v2.95.4 installed, also runs Apache on
Debian.


As long as you only *manipulate* the jpeg files, and do not display,
uploard or download them, it's very well possible. Knock yourself out,
as they say.
The downside is that you must implement all the manipulation algorithms
yourself, or use a third-party library. Standard C offers no ready-made
functions.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"Holy Banana of this, Sacred Coconut of that, Magic Axolotl of the other."
- Guardian in "Jinxter"
Nov 13 '05 #2
Greetings.

In article <39**************************@posting.google.com >, jock wrote:
Is it possible to perform basic image manipulation through C? I'd like
to upload images through a web interface and resize them so they are
limited to a max height/width restriction.


You certainly can, except for the uploading part. Since C contains no
built-in support for manipulating JPEGs, though, you'll probably find it
more convenient to find a third-party graphics library. Otherwise you'll
need to read up on graphics algorithms and the JPEG specification. Simply
open each JPEG as a binary file, read in the data into the appropriate data
structures, do whatever matrix operations you need to resize the image, and
write the data back out. If you're also writing the web interface, there's
a more-or-less standard C library out there by the name of cgic.

--
_
_V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited
/ |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <> In a haiku, so it's hard
(7_\\ http://www.nothingisreal.com/ >< To finish what you
Nov 13 '05 #3
jock wrote:

Hello,

Is it possible to perform basic image manipulation through C?
Yes, but there are no built-in capabilities to do so. You'll
need to find them elsewhere, or write your own.
I'd like
to upload images through a web interface and resize them so they are
limited to a max height/width restriction.
Note that C also lacks any notion of "upload" or "web." For
these, you'll need "C plus extensions" of some kind.
My hosting company has gcc v2.95.4 installed, also runs Apache on
Debian.


If such details make a difference to your question, your
question is almost certainly not about C but about the
"C plus
extensions" provided by the environment.

--
Er*********@sun.com
Nov 13 '05 #4
"jock" <jo*******@hotmail.com> wrote in message
news:39**************************@posting.google.c om...
Hello,

Is it possible to perform basic image manipulation through C?
Not with the C language alone. It can be done using a
combination of C and a few tools.
I'd like
to upload images through a web interface
Internet functionality will again, need special tools.
and resize them so they are
limited to a max height/width restriction.

My hosting company has gcc v2.95.4 installed, also runs Apache on
Debian.


See www.jpeg.org for free libraries for manipulating JPEG
files. Find an imaging library for actual image rendering
for your system. Find a networking library for your networking
needs. www.google.com

Note that your search terms will need to also describe
your platform, since all this is very platform dependent.

-Mike
Nov 13 '05 #5

"jock" <jo*******@hotmail.com> wrote in message

Is it possible to perform basic image manipulation through C? I'd like
to upload images through a web interface and resize them so they are
limited to a max height/width restriction.

Yes and no. You can write a JPEG codec in C, it it would be an enormous
task. However there will be code written for you that does this.If you get
the right library, it should be easy to decompress an image, crop it, and
then recode it.

You also need a non-standard library to access the web.
Nov 13 '05 #6


jock wrote:
Hello,

Is it possible to perform basic image manipulation through C?
You can do image manipulation via OpenCV and Tag Image File Format (TIFF).

http://sourceforge.net/projects/opencvlibrary/
http://chtiff.sourceforge.net/

I'd like
to upload images through a web interface and resize them so they are
limited to a max height/width restriction.
There are sample files to demonstrate image handling over the web.

http://www.softintegration.com/produ.../opencv/demos/

To handle upload images in C, you can try C/C++ interpreter Ch
with its free CGI toolkit. The Ch CGI APIs works similar to ASP or JSP,
easy to use. The latest release contains samples for how to
handle uploading files.

http://www.softintegration.com/products/toolkit/cgi/

of course, you can also try other C CGI library if you want to compile.



My hosting company has gcc v2.95.4 installed, also runs Apache on
Debian.

Thanks
Jock


Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Vinay | last post by:
Hi All: I have a small application that stores images either in the database or as files (depending on the user preference). I'm in the process of providing a web interface to this application....
3
by: Dalan | last post by:
At first I was not certain what could cause Access 97 from displaying most jpeg images, but not all. After further testing, it seemed that all original images of less than 275 pixels per inch or...
4
by: Rednelle | last post by:
Greetings all, As a newbie, using Access 2000, I would appreciate advice on the best way to include pictures. I have developed a 'Home Inventory' database which can include jpeg thumbnails of...
2
by: User10 | last post by:
Can some one provide an algorithm for motion detection between two jpeg frames? Or can you provide a more appropriate group to post this on? Thanks!
2
by: Anitha | last post by:
Hi All, How to retrieve images stored in Access database. I am storing images(jpeg) as OleObject. I want display them on my web page. I am unable to do so.Please help me I am using C# The code...
6
by: NutsAboutVB | last post by:
Hello, I am a .NET programmer and I have a JPEG image file (from digital camera) of about 109 KB's in size, when I open it and save it (without making any alterations at all, just going to File...
12
by: comp.lang.php | last post by:
index.php: // STUFF // STEP 1: imagecreatetruecolor ONLY IF GD 2.0+ SUPPORTED AND FOUND if ($this->isSuccessful && !$hasMogrified && $image && !$newImage &&...
13
by: Thierry | last post by:
Hi all, I'm programming a Knowledge Base application (VB 2005, Framework 2.0). I integrated a RichTextBox control so I can insert pictures. The problem now is the size of the saved document !...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.