0

Has anyone made a simple DLL for Windows, so i can just save raw image data into JPG format? It should have the .lib and .h files as well so i dont need to mess with the sources compiling since i have found it to be very hard.

Some point to take into account:

  • I cant compile libjpeg (ijg.org), i cant find binaries for it (dll/.lib/.h)
  • GD library website is down, and the new version requires PNG dll's etc even for JPG saving.
  • I dont want to use Windows internal JPG functions since i want to be able to run it on linux too.

Edit: I am trying to find as small library as possible: just writing a JPG (or reading too, if only a writing lib doesnt exist).

Larry Osterman
  • 16,086
  • 32
  • 60
Rookie
  • 4,064
  • 6
  • 54
  • 86
  • Maybe this is helpful to you: http://stackoverflow.com/questions/457370/c-how-to-convert-bitmap-byte-array-to-jpeg-format – abcde123483 Dec 04 '11 at 21:35
  • 2
    @ulvund, this is c++ project, not c#/.net – Rookie Dec 04 '11 at 21:52
  • Shouldn't this question be "how do I build libjpeg"? libjpeg will do what you need... – AshleysBrain Dec 04 '11 at 23:33
  • @AshleysBrain, i posted a question like that already http://stackoverflow.com/questions/8375789/how-to-build-this-project-jpeg-lib but since it seems nobody knows answer, i thought of switching the library instead. – Rookie Dec 04 '11 at 23:37

3 Answers3

2

Try jpeg-compressor, I think that it's the most simple one.

Abyx
  • 12,345
  • 5
  • 44
  • 76
  • Wow, exactly what im looking for! i'll see if i can make it work. – Rookie Dec 04 '11 at 23:47
  • BIG THANKS! it was everything i needed. Damn. amazing. – Rookie Dec 04 '11 at 23:52
  • @Rookie: You can also use GDI+ (see my other answer) - saving JPEG files is built into Windows. – Larry Osterman Dec 04 '11 at 23:57
  • @Larry, i know, but it wont work on linux then (as i said in my question). – Rookie Dec 04 '11 at 23:58
  • this thing took only 15KB space in my exe, just amazing. – Rookie Dec 05 '11 at 00:00
  • Your question was tagged Windows and not Linux and your question asks for a Windows DLL. You're right, I missed the "since i want to be able to run it on linux too." – Larry Osterman Dec 05 '11 at 00:01
  • damn, too bad this compressor has to be 1.5x slower than my previous library... i didnt know there can be such a huge performance differences, well, i guess i need to stick with this anyways. or maybe i messed it up myself... gotta check. – Rookie Dec 05 '11 at 00:28
0

Have you considered using FreeImage ?

Moo-Juice
  • 38,257
  • 10
  • 78
  • 128
  • I have not, i will look at it :) – Rookie Dec 04 '11 at 21:35
  • damn, that is huge library; i was thinking of something that has only the JPG writing, i dont need PNG or anything else. – Rookie Dec 04 '11 at 21:48
  • @Rookie, does it matter that it is a huge library? I admit, it does far more than what you're looking for. Is space an issue? – Moo-Juice Dec 04 '11 at 22:21
  • yes it does, the point was to find just JPG saving (or with loading as well) library, because i want to minimize the size of executables. atm i have 300KB library for saving JPG (using the old GDlib), but i lost my .lib/.h files so i cant compile my project anymore! i dont want to replace that tiny library with 2.8megabyte library, when my whole project takes around 1megabyte in total... – Rookie Dec 04 '11 at 23:33
  • I know what you've said about huge libraries, but what about DevIL? It seems to be a little smaller. Ultimately, to strip *any* solution down, you're going to need to reconfigure and recompile it yourself. – slugonamission Dec 04 '11 at 23:36
0

Why not use GDI+? It's built into Windows so you don't need to add any additional libraries.

This page shows an example of loading a bitmap image from a file on disk and saving it as a JPEG file (with different levels of encoding quality).

Larry Osterman
  • 16,086
  • 32
  • 60