Skip to content

Commit

Permalink
(v1.3.0) jpeg-9f (#4)
Browse files Browse the repository at this point in the history
* Update libjpeg source to 9f

* Update project version and docs

* Update CI test matrix and add install test
  • Loading branch information
csparker247 authored Jan 17, 2024
1 parent 9f4863e commit c3dc261
Show file tree
Hide file tree
Showing 77 changed files with 10,760 additions and 3,219 deletions.
57 changes: 22 additions & 35 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,69 +3,56 @@ name: Build and Test
on: [push, workflow_dispatch]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-10.15, macos-11, ubuntu-20.04]
os: [macos-11, macos-12, ubuntu-20.04, ubuntu-22.04]

steps:
- uses: actions/checkout@v2

- name: Setup Ubuntu
if: matrix.os == 'ubuntu-20.04'
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y cmake
- name: Setup macOS 10.15
if: matrix.os == 'macos-10.15'
- name: Setup macOS
if: startsWith(matrix.os, 'macos')
run: |
sudo xcode-select -s /Library/Developer/CommandLineTools/
sudo rm /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
sudo rm -rf /Library/Developer/CommandLineTools/SDKs/MacOSX11*.sdk
sudo ln -sf MacOSX10.15.sdk /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
sudo rm -rf /Library/Frameworks/Mono.framework
brew install cmake
- name: Setup macOS 11
if: matrix.os == 'macos-11'
run: |
sudo xcode-select -s /Library/Developer/CommandLineTools/
brew install cmake
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{runner.workspace}}/build

- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{runner.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
run: |
cmake -S $GITHUB_WORKSPACE -B ${{runner.workspace}}/build \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/install
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE
run: cmake --build ${{runner.workspace}}/build --config $BUILD_TYPE

- name: Test
- name: Test libjpeg
working-directory: ${{runner.workspace}}/build
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -V -C $BUILD_TYPE

- name: Test install
shell: bash
run: |
cmake --install ${{runner.workspace}}/build --config $BUILD_TYPE
RESULT=$(cmake --find-package -DNAME=JPEG \
-DCOMPILER_ID=GNU -DLANGUAGE=C -DMODE=COMPILE \
-DCMAKE_PREFIX_PATH=${{runner.workspace}}/install | awk '{$1=$1};1')
[[ "$RESULT" != "-I${{runner.workspace}}/install/include" ]] && { echo "libjpeg not found or found at unexpected location: ${RESULT}" ; exit 1; }
exit 0
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.0)
project(jpeg-cmake VERSION 1.2.1)
cmake_minimum_required(VERSION 3.5)
project(jpeg-cmake VERSION 1.3.0)

# Use configure_file insted of file(COPY)
# to ensure files are updated in src directory
Expand Down
42 changes: 17 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,33 @@
# IJG's libjpeg (with CMake)
Current Version: `libjpeg 9e (9.5.0)`
Current Version: `libjpeg 9f (9.6.0)`

## Usage
This project provides drop-in CMake support for the IJG's JPEG library.
Simply run CMake as normal:

```Shell
mkdir build/
cd build/
cmake ..
make
cmake -S . -B build/
cmake --build build/
```

Alternatively, the important CMake files can be copied to any `libjpeg`
source directory:
```Shell
cp resources/* ~/jpeg-9e/
cd ~/jpeg-9e/
mkdir build/
cd build/
cmake ..
make
cp resources/* ~/jpeg-9f/
cmake -S ~/jpeg-9f/ -B ~/jpeg-9f/build/
cmake --build ~/jpeg-9f/build/
```

## Updating libjpeg
```Shell
# Delete the contents of the libjpeg subdirectory
cd libjpeg/
rm -rf *
rm -rf libjpeg/*

# Copy the source files for libjpeg into the libjpeg subdirectory
cp -a ~/jpeg-9e/ .
cp -a ~/jpeg-9f/ libjpeg/

# Rerun the CMake build process
cd ../build/
cmake .
make
cmake --build build/
```

## Advanced Configuration
Expand Down Expand Up @@ -67,20 +59,20 @@ The default output format for djpeg can be specified with the `DEFAULT_FMT`
flag. To compile correctly, the flag must be set to one of the enum options
listed in `djpeg.c`:
* FMT_BMP
* FMT_GIF
* FMT_GIF0
* FMT_OS2
* FMT_PPM
* FMT_RLE
* FMT_TARGA
* FMT_TIFF
* FMT_GIF
* FMT_GIF0
* FMT_OS2
* FMT_PPM
* FMT_RLE
* FMT_TARGA
* FMT_TIFF

```Shell
cmake -DDEFAULT_FMT=FMT_BMP ..
```

#### Alternate UI
jpeg-9e provides an alternate command line interface for cjpeg and djpeg. This
jpeg-9e+ provides an alternate command line interface for cjpeg and djpeg. This
interface can be enabled with the `BUILD_ALT_UI` flag:
```Shell
cmake -DBUILD_ALT_UI=ON ..
Expand Down
19 changes: 10 additions & 9 deletions libjpeg/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,25 @@ DOCS= README install.txt usage.txt wizard.txt example.c libjpeg.txt \
structure.txt coderules.txt filelist.txt cdaltui.txt change.log

# Makefiles for various systems
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.xc \
makefile.bcc makefile.b32 makefile.c32 makefile.d32 makefile.x32 \
makefile.b64 makefile.mc6 makefile.dj makefile.wat makefile.vc \
makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 \
makejmak.vc6 makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 \
makeddsp.vc6 makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 \
makerdep.vc6 makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 \
makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
makejvcx.v17 makecvcx.v17 makedvcx.v17 maketvcx.v17 makervcx.v17 \
makewvcx.v17 makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st \
maktjpeg.st makefile.manx makefile.sas makefile.mms makefile.vms \
makvms.opt
makajpeg.bcb makcjpeg.bcb makdjpeg.bcb makljpeg.bcb makrjpeg.bcb \
maktjpeg.bcb makwjpeg.bcb makcjpeg.st makdjpeg.st makljpeg.st \
maktjpeg.st makeproj.mac makefile.manx makefile.sas makefile.mms \
makefile.vms makvms.opt

# Configuration files
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
jconfig.vms
CONFIGFILES= jconfig.cfg jconfig.xc jconfig.bcc jconfig.mc6 jconfig.dj \
jconfig.wat jconfig.vc jconfig.mac jconfig.st jconfig.manx \
jconfig.sas jconfig.vms

# Support scripts for configure
CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
Expand Down
20 changes: 11 additions & 9 deletions libjpeg/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
Expand Down Expand Up @@ -445,25 +446,26 @@ DOCS = README install.txt usage.txt wizard.txt example.c libjpeg.txt \


# Makefiles for various systems
MKFILES = configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
MKFILES = configure Makefile.in makefile.ansi makefile.unix makefile.xc \
makefile.bcc makefile.b32 makefile.c32 makefile.d32 makefile.x32 \
makefile.b64 makefile.mc6 makefile.dj makefile.wat makefile.vc \
makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 \
makejmak.vc6 makecdep.vc6 makecdsp.vc6 makecmak.vc6 makeddep.vc6 \
makeddsp.vc6 makedmak.vc6 maketdep.vc6 maketdsp.vc6 maketmak.vc6 \
makerdep.vc6 makerdsp.vc6 makermak.vc6 makewdep.vc6 makewdsp.vc6 \
makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
makejvcx.v17 makecvcx.v17 makedvcx.v17 maketvcx.v17 makervcx.v17 \
makewvcx.v17 makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st \
maktjpeg.st makefile.manx makefile.sas makefile.mms makefile.vms \
makvms.opt
makajpeg.bcb makcjpeg.bcb makdjpeg.bcb makljpeg.bcb makrjpeg.bcb \
maktjpeg.bcb makwjpeg.bcb makcjpeg.st makdjpeg.st makljpeg.st \
maktjpeg.st makeproj.mac makefile.manx makefile.sas makefile.mms \
makefile.vms makvms.opt


# Configuration files
CONFIGFILES = jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
jconfig.vms
CONFIGFILES = jconfig.cfg jconfig.xc jconfig.bcc jconfig.mc6 jconfig.dj \
jconfig.wat jconfig.vc jconfig.mac jconfig.st jconfig.manx \
jconfig.sas jconfig.vms


# Support scripts for configure
Expand Down
10 changes: 5 additions & 5 deletions libjpeg/README
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The Independent JPEG Group's JPEG software
==========================================

README for release 9e of 16-Jan-2022
README for release 9f of 14-Jan-2024
====================================

This distribution contains the ninth public release of the Independent JPEG
Expand Down Expand Up @@ -116,7 +116,7 @@ with respect to this software, its quality, accuracy, merchantability, or
fitness for a particular purpose. This software is provided "AS IS", and you,
its user, assume the entire risk as to its quality and accuracy.

This software is copyright (C) 1991-2022, Thomas G. Lane, Guido Vollbeding.
This software is copyright (C) 1991-2024, Thomas G. Lane, Guido Vollbeding.
All Rights Reserved except as specified below.

Permission is hereby granted to use, copy, modify, and distribute this
Expand Down Expand Up @@ -240,9 +240,9 @@ The "official" archive site for this software is www.ijg.org.
The most recent released version can always be found there in
directory "files". This particular version will be archived
in Windows-compatible "zip" archive format as
https://www.ijg.org/files/jpegsr9e.zip, and
https://www.ijg.org/files/jpegsr9f.zip, and
in Unix-compatible "tar.gz" archive format as
https://www.ijg.org/files/jpegsrc.v9e.tar.gz.
https://www.ijg.org/files/jpegsrc.v9f.tar.gz.

The JPEG FAQ (Frequently Asked Questions) article is a source of some
general information about JPEG.
Expand Down Expand Up @@ -371,4 +371,4 @@ to overcome the limitations of the original JPEG specification,
and is the first true source reference JPEG codec.
More features are being prepared for coming releases...

Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org.
Please send bug reports, offers of help, etc. to jpeg-info@ijg.org.
Loading

0 comments on commit c3dc261

Please sign in to comment.