-
-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile with MozJPEG #41
Comments
I researched more and I tried:
Now it runs fine, but I am not sure if it is using the mozjpeg library.
So the 2 files has different file sizes. |
Had to add /opt/mozjpeg/lib64 to ldconfig manually, but now jpegoptim creates files 3-4% smaller than before. |
a buddy and I were just talking about this yesterday and he came up with these instructions, which also work on Mac OS if you have homebrew installed (for pkg tools). Just for reference if anyone wants the steps to do this. Props to @wseemann :
|
a bit late but it might be helpful to somebody else |
Users of CentOS / RedHat 7 may want to install jpegoptim compiled with MozJPEG using these instructions (no compilation required, ready to install package). |
If you are OK with using ABI 8 of libjpeg then this works.
Now build jpegoptim
Now as root, tell jpegoptim where the library is |
Guys, can you verify what should be the output when mozjpeg is enabled? I am compiling with @ubuntu:~/scripts/jpegoptim$ ./configure CPPFLAGS=-I/opt/mozjpeg/include LDFLAGS=-L/opt/mozjpeg/lib64 --with-libjpeg=/opt/mozjpeg/lib64
@ubuntu:~/scripts/jpegoptim$ make
gcc -g -O2 -I/opt/mozjpeg/include -I/opt/mozjpeg/lib64 -DHAVE_CONFIG_H -c -o jpegoptim.o jpegoptim.c
gcc -g -O2 -I/opt/mozjpeg/include -I/opt/mozjpeg/lib64 -DHAVE_CONFIG_H -c -o jpegdest.o jpegdest.c
gcc -g -O2 -I/opt/mozjpeg/include -I/opt/mozjpeg/lib64 -DHAVE_CONFIG_H -c -o misc.o misc.c
gcc -g -O2 -I/opt/mozjpeg/include -I/opt/mozjpeg/lib64 -DHAVE_CONFIG_H -o jpegoptim jpegoptim.o jpegdest.o misc.o -L/opt/mozjpeg/lib64 -L/opt/mozjpeg/lib64 -lm -ljpeg
```
Output is:
```
ubuntu:~/scripts/jpegoptim$ /usr/local/bin/jpegoptim -V
jpegoptim v1.4.6 x86_64-unknown-linux-gnu
Copyright (C) 1996-2018, Timo Kokkonen
This program comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistirbute it under certain conditions.
See the GNU General Public License for more details.
libjpeg version: 6b 27-Mar-1998
Copyright (C) 1991-2018 The libjpeg-turbo Project and many others
``` |
@adrianmihalko the output of The best way to check if you have successfully compiled MozJPEG in is with |
Thank you, based on this I think mozjpeg is enabled: $ ldd /usr/local/bin/jpegoptim | grep jpeg |
If you want some more detail
|
I think after 3 years I can close this issue. Thanks for tips. |
I am not a CLI master, can you please provide me more details about how to compile with MozJPEG support?
I tried:
mozilla/mozjpeg#232 (comment)
The text was updated successfully, but these errors were encountered: