Go to file
DRC 9cb270a216 Use mozjpeg defaults by default
Since mozjpeg is now backward ABI-compatible with libjpeg[-turbo], it is now
possible to temporarily load mozjpeg into a binary application and cause that
application to generate uber-compressed JPEGs (at the expense of an extreme
performance loss, of course.)  For instance, someone could do

LD_LIBRARY_PATH=/opt/mozjpeg/lib convert blah_blah_blah

to make ImageMagick use mozjpeg instead of the system's pre-installed JPEG
library (libjpeg-turbo, in most cases.)  However, this only makes sense if
mozjpeg is actually producing different behavior by default than libjpeg-turbo.
Currently it isn't.  Currently it requires the application to set
JBOOLEAN_USE_MOZ_DEFAULTS to TRUE in order to enable the mozjpeg-specific
behavior, but of course applications that were built to use libjpeg[-turbo]
won't do that.  Thus, this patch sets use_moz_defaults to TRUE by default,
requiring an application to explicitly set it to FALSE in order to revert to
the libjpeg[-turbo] behavior (makes sense, since the only applications that
would need to revert to the libjpeg[-turbo] behavior would be mozjpeg-aware
applications.)

Note that we discussed the possibility of adding a function
(jpeg_revert_defaults()), which would act the same as jpeg_set_defaults() does
in libjpeg[-turbo].  This is a good solution for implementing the -revert
switch in cjpeg, but unfortunately it doesn't work for jpegtran.  The reason
is that jpeg_set_defaults() is called within the body of
jpeg_copy_critical_parameters(), which is part of the API.  So yet again,
if mozjpeg were loaded into a non-mozjpeg-aware application at run time, it
would be desirable for jpeg_copy_critical_parameters() to set the parameters
to mozjpeg defaults.  That means that, in order to implement the -revert
switch in jpegtran, it would be necessary to introduce a new function
(jpeg_revert_critical_parameters(), perhaps).  It seems cleaner to just keep
using the JBOOLEAN_USE_MOZ_DEFAULTS parameter to control the behavior of
jpeg_set_defaults(), even though this represents a minor abuse of the libjpeg
API (jpeg_set_defaults() is technically supposed to set all of the parameters
to defaults, irrespective of any previous state.  However, as long as we
document that JBOOLEAN_USE_MOZ_DEFAULTS works differently, then it should be
OK.)
2014-11-19 23:31:20 -06:00
2014-09-07 18:21:19 +01:00
2014-08-30 13:51:18 +00:00
2014-11-06 09:32:06 +00:00
2014-09-07 18:21:19 +01:00
2014-11-08 16:36:45 +00:00
2014-08-09 23:06:07 +00:00
2014-08-28 14:17:20 -04:00
2014-09-07 18:20:38 +01:00
2014-02-27 15:26:48 -06:00
2014-11-19 23:31:20 -06:00
2014-11-19 23:31:20 -06:00
2014-11-19 23:31:20 -06:00
2014-09-07 16:51:55 +01:00
2014-08-09 23:06:07 +00:00
2014-11-19 23:31:20 -06:00
2014-08-21 22:16:25 +00:00
2014-08-09 23:06:07 +00:00
2014-05-18 17:52:06 +00:00
2014-07-23 10:26:46 -04:00
2014-08-09 23:06:07 +00:00
2014-07-24 10:50:59 -04:00
2014-11-19 23:31:20 -06:00
2014-09-07 16:59:11 +01:00
2014-05-29 19:31:45 +00:00
2014-08-04 01:18:00 +01:00
2014-11-06 01:30:06 -06:00
2014-09-07 16:59:11 +01:00
2014-11-19 23:31:20 -06:00
2014-08-30 22:00:33 +00:00
2014-06-26 12:45:03 -04:00
2014-11-19 23:31:20 -06:00

Mozilla JPEG Encoder Project

This project's goal is to reduce the size of JPEG files without reducing quality or compatibility with the vast majority of the world's deployed decoders.

The idea is to reduce transfer times for JPEGs on the Web, thus reducing page load times.

'mozjpeg' is not intended to be a general JPEG library replacement. It makes tradeoffs that are intended to benefit Web use cases and focuses solely on improving encoding. It is best used as part of a Web encoding workflow. For a general JPEG library (e.g. your system libjpeg), especially if you care about decoding, we recommend libjpeg-turbo.

More information:

Languages
C 54.6%
Assembly 26.7%
HTML 8.9%
Java 4.4%
CMake 2.4%
Other 2.9%