Skip to content

Commit 86caef6

Browse files
authored
Merge pull request #3 from johnnychen94/jc/encode
initial implementation for `jpeg_encode` and `jpeg_decode`
2 parents 013210c + 5798d88 commit 86caef6

17 files changed

+1538
-2
lines changed

.github/workflows/UnitTest.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,20 @@ jobs:
4545
- uses: codecov/codecov-action@v2
4646
with:
4747
files: lcov.info
48-
48+
multithreads:
49+
name: Julia (threads) 1 - ubuntu-latest - x64 - ${{ github.event_name }}
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v2
53+
- uses: julia-actions/setup-julia@v1
54+
with:
55+
version: '1'
56+
arch: 'x64'
57+
- uses: julia-actions/cache@v1
58+
- uses: julia-actions/julia-buildpkg@v1
59+
- name: run test
60+
run: julia --project --code-coverage -t4 -e 'using Pkg; Pkg.test()'
61+
- uses: julia-actions/julia-processcoverage@v1
62+
- uses: codecov/codecov-action@v2
63+
with:
64+
files: lcov.info

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ version = "0.1.0"
55

66
[deps]
77
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
8+
ImageCore = "a09fc81d-aa75-5fe9-8630-4744c3626534"
89
JpegTurbo_jll = "aacddb02-875f-59d6-b918-886e6ef4fbf8"
910

1011
[compat]
1112
CEnum = "0.3, 0.4"
13+
ImageCore = "0.8, 0.9"
1214
JpegTurbo_jll = "~2.1"
1315
julia = "1.6"

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,44 @@
44
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://johnnychen94.github.io/JpegTurbo.jl/dev)
55
[![Build Status](https://github.com/johnnychen94/JpegTurbo.jl/actions/workflows/UnitTest.yml/badge.svg?branch=master)](https://github.com/johnnychen94/JpegTurbo.jl/actions/workflows/UnitTest.yml?query=branch%3Amaster)
66
[![Coverage](https://codecov.io/gh/johnnychen94/JpegTurbo.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/johnnychen94/JpegTurbo.jl)
7+
8+
JpegTurbo.jl is a Julia wrapper of the C library [libjpeg-turbo] that provides IO support for
9+
the JPEG image format.
10+
11+
The main functionality of this package consist of two functions: `jpeg_encode` and `jpeg_decode`.
12+
Check the [function references](https://johnnychen94.github.io/JpegTurbo.jl/dev/reference) for more
13+
details.
14+
15+
## API
16+
17+
`jpeg_encode` is used to compress 2D colorant matrix as JPEG image.
18+
19+
```julia
20+
jpeg_encode(filename::AbstractString, img; kwargs...) -> Int
21+
jpeg_encode(io::IO, img; kwargs...) -> Int
22+
jpeg_encode(img; kwargs...) -> Vector{UInt8}
23+
```
24+
25+
`jpeg_decode` is used to decompress JPEG image as 2D colorant matrix.
26+
27+
```julia
28+
jpeg_decode([T,] filename::AbstractString; kwargs...) -> Matrix{T}
29+
```
30+
31+
## Feature set
32+
33+
| function | filename | IOStream | in-memory buffer | pre-allocated output | multi-threads |
34+
| -------------------- | -------- | -------- | -------------------- | ------------------- | ------------- |
35+
| `jpeg_encode` | x | x | x | | x |
36+
| `jpeg_decode` | x | | | | x |
37+
| `ImageMagick.save` | x | x | x | | x |
38+
| `ImageMagick.load` | x | x | x | | x |
39+
| `QuartzImageIO.save` | x | x | x (`FileIO.Stream`) | | x |
40+
| `QuartzImageIO.load` | x | x | x (`FileIO.Stream`) | | x |
41+
42+
Notes:
43+
44+
- `x`: supported
45+
- empty: missing/unsupported yet
46+
47+
[libjpeg-turbo]: https://github.com/libjpeg-turbo/libjpeg-turbo

0 commit comments

Comments
 (0)