Source code
Revision control
Copy as Markdown
Other Tools
== 2026-04-12 (libjpeg-turbo v3.1.2) ==
* Updated to v3.1.2 release.
* Replaced jpeg12/ and jpeg16/ subdirectories with src/wrapper/ using
upstream wrapper files (jcapistd-8.c, -12.c, -16.c, etc.) that set
BITS_IN_JSAMPLE internally via #define.
* Updated update.py check_source_lists() for new JPEG_SOURCES structure
(no more separate JPEG12_SOURCES/JPEG16_SOURCES cmake variables).
== Automated update (preferred) ==
1. Fetch the new upstream source and register file changes with version control:
$ ./mach vendor media/libjpeg/moz.yaml -r <new-tag> --patch-mode none
Review the VCS diff. For routine version bumps only existing files change
(hg status shows only M). If files were added or removed (A or R in hg
status), handle them before committing (see "Handling new and removed files"
below). Commit all changes from this step before proceeding to step 2.
2. Apply the Mozilla patches and run the post-vendor update script:
$ ./mach vendor media/libjpeg/moz.yaml -r <new-tag> --patch-mode only
The update script (update.py) handles version string updates and the
moz.yaml revision field automatically. If it exits non-zero, it will print
guidance explaining what needs attention. Common cases:
"Source list mismatch" -- upstream changed which .c files are compiled:
Update the relevant moz.build file(s) to match the new CMakeLists.txt
source lists, then re-run step 2.
"Config template files changed" -- a jconfig template file changed beyond
the auto-updated version strings: review the diff and manually update
the corresponding in-tree file (jconfig.h, jconfigint.h, jversion.h,
or simd/arm/neon-compat.h) as needed, then re-run step 2.
"Unhandled file changes in the vendored tree" -- a new file appeared in
the tip commit that update.py does not know how to classify. Decide
what to do with it (see "Handling new and removed files" below), then
re-run step 2 (or step 1 then step 2 if moz.yaml's exclude list changed).
== Handling new and removed files ==
When upstream adds a new file it will appear as A (added) in hg status after
step 1. Decide what to do based on the file type:
.c file listed in CMakeLists.txt JPEG_SOURCES / JPEG12_SOURCES /
JPEG16_SOURCES -- Firefox needs to compile it. Add it to SOURCES in the
appropriate moz.build (moz.build, jpeg12/moz.build, or jpeg16/moz.build).
Note: update.py's "Source list mismatch" check will catch this automatically.
.c file NOT in any CMakeLists.txt source list -- it is a standalone utility
or test program that Firefox does not need. Add it (and any associated .h
files) to the 'exclude:' list in moz.yaml, then re-run step 1 so that mach
vendor removes it from the tree.
.h file -- headers are always allowed in the tree; no action required unless
the file is a standalone utility header associated with an excluded .c file,
in which case also add it to 'exclude:' in moz.yaml.
Other file (metadata, config, build system) -- if Firefox needs it in the
tree but it will not be compiled, add its basename to KNOWN_NON_MOZ_BUILD_FILES
in update.py. If it is not needed at all, add it to 'exclude:' in moz.yaml.
When upstream removes a file it will appear as R (removed) in hg status.
If it was in a moz.build SOURCES block, remove it from there. update.py's
"removed (still in moz.build)" check will catch this automatically.
== Manual update (fallback) ==
If the automated update cannot be used, do the following:
* Clone (or fetch) libjpeg-turbo and check out the new tag:
$ cd libjpeg-turbo && git fetch --tags
* Find files added or deleted between the old and new upstream tags. Files
deleted upstream must be explicitly removed from the tree because the
git archive step below only extracts files, it does not delete anything.
$ git diff --name-status OLD_TAG NEW_TAG | grep '^[AD]'
For each deleted file (D): remove it from the tree and from version control:
With hg (from the mozilla-central root):
$ hg rm media/libjpeg/<filename>
With git (from the mozilla-central root):
$ git rm media/libjpeg/<filename>
New files (A) will be picked up automatically in the steps below.
* From the mozilla-central root, overwrite the existing vendor tree with the
new upstream source:
$ (cd /path/to/libjpeg-turbo && git archive --prefix=media/libjpeg/ NEW_TAG) | \
tar xf -
* From media/libjpeg/, remove upstream files that Firefox does not need
(as listed in the 'exclude:' section of moz.yaml):
$ cd media/libjpeg
$ python3 -c "
import shutil, os, yaml
data = yaml.safe_load(open('moz.yaml'))
for x in data['vendoring']['exclude']:
shutil.rmtree(x, True) if os.path.isdir(x) else os.path.exists(x) and os.remove(x)
"
* From the mozilla-central root, register any new upstream files with version
control. Newly added files from the git archive step are untracked; this
makes them known to version control:
With hg:
$ hg addremove media/libjpeg/
With git:
$ git add media/libjpeg/
Review the newly added and removed files and handle them following the
guidance in "Handling new and removed files" above.
* From media/libjpeg/, apply the Mozilla patch:
$ patch -p1 < mozilla.diff
* From media/libjpeg/, run the update script to update version strings and
check source lists:
$ python3 update.py
If it exits non-zero, follow the guidance it prints.
* Update the release field in moz.yaml (the revision field is updated
automatically by update.py).
== (libjpeg-turbo v3.1.0) ==
* Updated to v3.1.0 release.
* All source files moved upstream to src/ subdirectory.
* Updated moz.build, jpeg12/moz.build, jpeg16/moz.build for new src/ paths.
* Updated mozilla.diff patch target to src/jmorecfg.h.
* Updated moz.yaml exclude list and update.py for new src/ layout.
== September 14, 2024 (libjpeg-turbo v3.0.4 f29eda648547b36aa594c4116c7764a6c8a079b9 2024-09-14) ==
* Updated to v3.0.4 release.
== May 30, 2024 ==
== May 9, 2024 (libjpeg-turbo v3.0.3 7fa4b5b762c9a99b46b0b7838f5fd55071b92ea5 2024-05-08) ==
* Updated to v3.0.3 release.
== February 8, 2023 (libjpeg-turbo v2.1.5.1 8ecba3647edb6dd940463fedf38ca33a8e2a73d1 2023-02-08) ==
* Updated to v2.1.5.1 release.
== November 10, 2022 (libjpeg-turbo v2.1.4 8162eddf041e0be26f5c671bb6528723c55fed9d 2022-08-12) ==
* Updated to v2.1.4 release.
== February 28, 2022 (libjpeg-turbo v2.1.3 c5f269eb9665435271c05fbcaf8721fa58e9eafa 2022-02-25) ==
* Updated to v2.1.3 release.
== September 9, 2021 (libjpeg-turbo v2.1.1 0a9b9721782d3a60a5c16c8c9a7abf3d4b1ecd42 2020-08-10) ==
* Updated to v2.1.1 release.
== November 19, 2020 (libjpeg-turbo v2.0.6 10ba6ed3365615ed5c2995fe2d240cb2d5000173 2020-11-16) ==
* Updated to v2.0.6 release.
== January 6, 2020 (libjpeg-turbo v2.0.4 166e34213e4f4e2363ce058a7bcc69fd03e38b76 2019-12-31) ==
* Updated to v2.0.4 release.
== September 5, 2019 (libjpeg-turbo v2.0.3 5db6a6819d0f904e0b58f34ae928fea234adb1a0 2019-09-04) ==
* Updated to v2.0.3 release.
== October 4, 2018 (libjpeg-turbo v2.0.0 574f3a772c96dc9db2c98ef24706feb3f6dbda9a 2018-06-27) ==
* Updated to v2.0.0 release.
== July 13, 2017 (libjpeg-turbo v1.5.2 e5c1613ccdfeffcd060fd94248b7c8ac7c0cfb0f 2017-08-09) ==
* Updated to v1.5.2 release.
== September 22, 2016 (libjpeg-turbo v1.5.1 cb88e5da8003afcdc443b787fdcb77285e5a8a02 2016-09-20) ==
* Updated to v1.5.1 release.
== June 23, 2016 (libjpeg-turbo v1.5.0 3ff13e651bbe6de9c6f15d05235d1d4f26f63ffc 2016-05-31) ==
* Updated to v1.5.0 release.
== October 5, 2015 (libjpeg-turbo v1.4.2 d8da49effe6460d55239c4c009c57f42d8e4a494 2015-09-21) ==
* Updated to v1.4.2 release.
== January 15, 2015 (libjpeg-turbo v1.4.0 r1481 2015-01-07) ==
* Updated to v1.4.0 release.
== March 24, 2014 (libjpeg-turbo v1.3.1 r1205 2014-03-22) ==
* Updated to v1.3.1 release.
== November 25, 2013 ==
== June 4, 2013 (libjpeg-turbo v1.3.0 r988 2013-05-25) ==
* Updated to v1.3.0 release.
== December 12, 2012 ==
* Replace the runtime computed jpeg_nbits_table with constants in
== October 13, 2012 ==
== July 4, 2012 (libjpeg-turbo v1.2.1 r853 2012-06-30) ==
* Updated to v1.2.1 stable release.
== June 5, 2012 (libjpeg-turbo v1.2.x branch, r831 2012-05-30) ==
== February 10, 2012 (libjpeg-turbo v1.2.0 r807 2012-02-10) ==
* Imported jchuff.c, jdhuff.c, jdhuff.h under new licensing.
* Created mozilla.diff for the required jmorecfg.h changes and to allow for any
future changes made by Mozilla to upstream files.
* Removed the following files which are unused by the Mozilla build:
cderror.h, cdjpeg.h, jconfig.h.in, transupp.h, simd/jsimdcfg.inc.h
== March 28, 2011 (initial commit, libjpeg-turbo v1.1.0 r469 2011-02-27) ==
* Modified jmorecfg.h to define UINT8, UINT16, INT16, and INT32 in terms of
prtypes to fix a build error on Windows.
* Defined INLINE as NS_ALWAYS_INLINE in jconfig.h.
* Removed the following files which are licensed under the wxWindows license:
bmp.c, bmp.h, jpegut.c, jpgtest.cxx, rrtimer.h, rrutil.h, turbojpeg.h,
turbojpegl.c
* Reverted the following files to what was previously in Mozilla's tree
(nominally libjpeg 6.2):
jchuff.c, jdhuff.c, jdhuff.h
since the versions of these files in libjpeg-turbo are also under the
wxWindows license. (It would have been nicer to revert them to the new
libjpeg-8b code, but that doesn't easily integrate with libjpeg-turbo.)