tags:

views:

82

answers:

3

I'd like to find a JPEG-writing library that can be statically linked (so there are no DLL dependencies). No JPEG-reading ability is required.

Edit: I got LibGD working, but it had one problem described here:

http://stackoverflow.com/questions/2307965/libgd-library-is-not-working-crash-when-saving-image

+3  A: 

libjpeg is the most popular library for saving jpegs, but it can be a bit of a pain to use.

Edit, here is a simple example of how to use it. Look for the function juce_writeJPEGImageToStream.

FigBug
can you send the .lib file download link too, i cant compile that
Newbie
+1  A: 

Have you looked at LibGD? I can't seem to find the license, but neither did you specify a requirement.

phkahler
GD seems to be under its own licence, which is similar to the ISC licence. Of course, actually read the licence to know what your obligations are. :-)
Chris Jester-Young
+1  A: 

If you're running your application on Windows then you should use the standard, built-in "GDI+" library that Microsoft provides. Every computer running XP or later has this library.

GDI+ is intended to supersede GDI, which is what you're probably already using whether you know it or not, but it can co-exist with GDI calls provided you flush the buffers when switching between the two. See:

http://www.cpjj.net/Miscellaneous/CreateJPEGFromDC.htm

(Hans Passant - you should have written your comment as an answer).

Tim Cooper