tjko / jpegoptim

jpegoptim - utility to optimize/compress JPEG files
http://www.iki.fi/tjko/projects.html
GNU General Public License v3.0
1.59k stars 117 forks source link

for Windows #18

Closed szepeviktor closed 2 years ago

szepeviktor commented 10 years ago

Could you please link http://sourceforge.net/projects/jpegoptim/ ?

shinnn commented 9 years ago

-1

Seems to be abandoned. The latest build is still v1.3.0. http://sourceforge.net/projects/jpegoptim/files/jpegoptim/

szepeviktor commented 9 years ago

So there's no uptodate win32 port? Where is the howto for mingw32 or cygwin build?

shinnn commented 9 years ago

I cannot find them anywhere, and I want them too.

szepeviktor commented 9 years ago

The exe on SourceForge has the string msvcrt.dll in it.

sbrl commented 9 years ago

I am willing to build jpegoptim for windows - I have a MinGW32 environment setup. Currently When I try to ./configure with bash for windows I get the following:

checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... yes
checking for jpeg_read_header in -ljpeg... no
Cannot find libjpeg or you have too old version (v6 or later required).

Does anyone know how to get past that?

szepeviktor commented 9 years ago

Maybe you should install an updated version of libjpeg. v9 is the latest. I suggest you to use mozjpeg which is much better.

sbrl commented 9 years ago

@szepeviktor Installing libjpeg doesn't help. I have a prebuilt version of mozjpeg though, now I just need a wrapper like jpegoptim that takes care of the file manipulation (mozjpeg doesn't allow you to overwrite the original file). Perhaps I could write one myself.

szepeviktor commented 9 years ago

The tool I use is https://github.com/danielgtaylor/jpeg-archive.

sbrl commented 9 years ago

@szepeviktor That tool looks rather good actually. I think I might switch to using that instead! It looks like it achieves a much higher level of compression (even if it is a bit lossy). The result looks almost identical to the original, which is the main thing.

Thanks for all your help :)

dreamlayers commented 8 years ago

It's not hard to cross-compile a Windows binary in Cygwin. I prefer that because it's a more Unix-like environment so less things break during the build process.

First get mozjpeg. It will be slower but give better progressive compression rates than libjpeg. I got mozjpeg-3.1-release-source.tar.gz from the releases page. There's a lot of work going on there, and I don't want to risk some insufficiently tested work in progress messing up my images. If using mozjpeg, use a jpegoptim version after f3701c9 because otherwise all images will probably be progressive. It will still default to progressive, so you need the --all-normal switch if you don't want that.

I'm using the i686-w64-mingw32 compiler in Cygwin. Mozjpeg is easy to build via ./configure --host=i686-w64-mingw32 followed by make. It eventually failed because I didn't have libpng, but I don't care because it already built the libraries. I didn't want to install mozjpeg, so I configured jpegoptim while providing paths to mozjpeg: CPPFLAGS=-I../mozjpeg LDFLAGS=-L../mozjpeg/.libs ./configure --host=i686-w64-mingw32. Finally, I re-built jpegoptim with an edited command, replacing -ljpeg with the static mozjpeg library so it doesn't depend on the mozjpeg DLL: i686-w64-mingw32-gcc -g -O2 -I../mozjpeg -DHAVE_CONFIG_H -o jpegoptim jpegoptim.o jpegdest.o misc.o -L../mozjpeg/.libs -lm ../mozjpeg/.libs/libjpeg.a

Finally here is the win32 binary.

XhmikosR commented 7 years ago

If anyone's interested https://github.com/XhmikosR/jpegoptim-windows/releases