Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b2fbdf2
Add jpeg-encoder as a conditional dependency
Shnatsel Oct 30, 2025
c898457
Initial conversion pass from built-in JPEG encoder to jpeg-encoder crate
Shnatsel Oct 30, 2025
41d9aba
Remove a great deal of now-unused code
Shnatsel Oct 30, 2025
0a845dd
cargo fmt
Shnatsel Oct 30, 2025
1e50e53
Error handling in setting ICC profile
Shnatsel Oct 30, 2025
0823351
Reinstate the DimensionMismatch errors when passing images that are t…
Shnatsel Oct 30, 2025
b25355f
Fulfill an old TODO to return an EncodingError instead of a Dimension…
Shnatsel Oct 30, 2025
78c1405
Wire up writing Exif
Shnatsel Oct 30, 2025
4f530ef
add a test for roundtripping Exif and ICC
Shnatsel Oct 30, 2025
db9ae3f
Fix Exif roundtrip
Shnatsel Oct 30, 2025
a431504
Error handling in encoding
Shnatsel Oct 30, 2025
819b059
Remove last vestiges of in-tree JPEG encoder
Shnatsel Oct 30, 2025
bf2b2d0
Replace todo!() with an interim solution that doesn't panic
Shnatsel Oct 30, 2025
3d72ef8
Merge remote-tracking branch 'origin/main' into jpeg-encoder
Shnatsel Nov 2, 2025
a22a2f7
Replace previous ad-hoc error with usage of the custom EncoderError type
Shnatsel Nov 2, 2025
8e7df44
Drop unused imports
Shnatsel Nov 2, 2025
a7fef3c
Satisfy clippy
Shnatsel Nov 2, 2025
0dcffea
Fix encoding benchmark
Shnatsel Nov 2, 2025
e7a31cc
Do not defer writing Exif metadata to the encoder
Shnatsel Nov 2, 2025
274bc19
Explicitly allow IJG in deny.toml to admit jpeg-encoder as a dependen…
Shnatsel Nov 2, 2025
1f2b19c
Add a method for controlling subsampling mode
Shnatsel Nov 3, 2025
31eef2c
Expose a function to control optimizing Huffman tables
Shnatsel Nov 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ rgb = { version = "0.8.48", default-features = false, optional = true }
tiff = { version = "0.10.3", optional = true }
zune-core = { version = "0.5.0", default-features = false, optional = true }
zune-jpeg = { version = "0.5.5", optional = true }
jpeg-encoder = { version = "0.6.1", optional = true, features = ["simd"] }
serde = { version = "1.0.214", optional = true, features = ["derive"] }

[dev-dependencies]
Expand All @@ -77,7 +78,7 @@ ff = [] # Farbfeld image format
gif = ["dep:gif", "dep:color_quant"]
hdr = []
ico = ["bmp", "png"]
jpeg = ["dep:zune-core", "dep:zune-jpeg"]
jpeg = ["dep:zune-core", "dep:zune-jpeg", "dep:jpeg-encoder"]
png = ["dep:png"]
pnm = []
qoi = ["dep:qoi"]
Expand Down
6 changes: 3 additions & 3 deletions benches/encode.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
extern crate criterion;

use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
use image::ExtendedColorType;
use image::{codecs::bmp::BmpEncoder, codecs::jpeg::JpegEncoder, ColorType};
use image::{ExtendedColorType, ImageEncoder};

use std::fs::File;
use std::io::{BufWriter, Seek, SeekFrom, Write};
Expand Down Expand Up @@ -128,7 +128,7 @@ impl EncoderBase for Bmp {

impl EncoderBase for Jpeg {
fn encode(&self, mut into: impl Write, im: &[u8], size: u32, color: ExtendedColorType) {
let mut x = JpegEncoder::new(&mut into);
x.encode(im, size, size, color).unwrap();
let x = JpegEncoder::new(&mut into);
x.write_image(im, size, size, color).unwrap();
}
}
1 change: 1 addition & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ allow = [
"BSD-3-Clause",
"MIT",
"Unicode-3.0",
"IJG", # for parts of jpeg-encoder ported from IJG libjpeg; highly permissive
]

[[licenses.exceptions]]
Expand Down
Loading
Loading